List:MySQL++« Previous MessageNext Message »
From:christophe guerber Date:July 24 2006 10:20am
Subject:RE : Re: bound between SSQLS structure name and table name
View as plain text  
Hi Warren,

> Yes.  My own code does this regularly.  I don't
> understand why you bring
> _names into this at all.

My first try was to use the MYSQLPP_SSQLS_NO_STATICS
macro to avoid the _table definition. But this also
removes the _name definition part. That's why I
mentioned it.

> You simply assign the underlying SQL table
> name to MyClassName::_table early in the program's
> execution.  It's no more difficult than that.

Ok, this works well. Nevertheless, from a theoretical
point of view, I would prefer not to change the value
of a static member from outside the class (even within
one of its children).

Another way (I actually use this now), is to use name
spaces. In the following example, whatever::Person is
the SSQLS structure and Person is the exported class
with all the nice method I want to have.
namespace whatever {
sql_create_1(Person,1,0,mysqlpp::sql_int,id);
};
class Person : private whatever::Person {
    void NiceMethod();
    void VeryCoolMethod();
};
Thanks for the response.



	

	
		
___________________________________________________________________________ 
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! 
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos
expériences. 
http://fr.answers.yahoo.com 

Thread
bound between SSQLS structure name and table namechristophe guerber11 Jul
  • Re: bound between SSQLS structure name and table nameWarren Young18 Jul
    • RE : Re: bound between SSQLS structure name and table namechristophe guerber24 Jul