Wexus2 0.20
wexus::ActiveClass Class Reference

#include <ActiveClass.h>

List of all members.

Classes

class  ActiveField
class  ActiveFieldType

Public Types

enum  { keyStyle = 1, varStyle, fKeyStyle }
typedef QVector
< std::shared_ptr< ActiveField > > 
FieldVec
typedef QMap< QString,
std::shared_ptr< ActiveField > > 
FieldMap

Public Member Functions

 ActiveClass (const QString &_className)
 ctor
const QString & className (void) const
const QString & tableName (void) const
const QString & fieldsAsList (void) const
const QString & fieldsAsListSansTable (void) const
const QString & questionsAsList (void) const
int keyColumn (void) const
std::shared_ptr< ActiveFieldkeyField (void) const
void createTable (void) const
 creates the table in the database
FieldVec & fieldsVec (void)
const FieldVec & fieldsVec (void) const
FieldMap & fieldsMap (void)
const FieldMap & fieldsMap (void) const

Static Public Member Functions

static QString toSqlType (const QString &t)

Protected Member Functions

template<class RECT , class DATT >
void addField (int style, const QString &fieldName, const QString &fieldType, const ValidationExpr &valexpr, const QVariant &initVal, typename ActiveFieldType< RECT, DATT >::MemberPtr memberptr)
 field adder
void doneConstruction (void)
 called by descendants construtors

Detailed Description

Represents a wexus::ActiveRecord type. Every wexus::ActiveRecord has a link to one of these.

Author:
Aleksander Demko

Member Enumeration Documentation

anonymous enum

Field "styles".

various "styles" of keys. I really want to call these "types", but that would conflict with fieldType() already.

Author:
Aleksander Demko

Member Function Documentation

const QString& wexus::ActiveClass::className ( void  ) const [inline]

The C++ class name of this type.

Author:
Aleksander Demko
const QString& wexus::ActiveClass::fieldsAsList ( void  ) const [inline]

Returns all the field names as one string, seperated by commas. Each field name will be prefixed by tableName().

Author:
Aleksander Demko
const QString& wexus::ActiveClass::fieldsAsListSansTable ( void  ) const [inline]

Returns all the field names as one string, seperated by commas.

Author:
Aleksander Demko
const FieldMap& wexus::ActiveClass::fieldsMap ( void  ) const [inline]

Returns all the fields as a map keyed by their field names.

Author:
Aleksander Demko
FieldMap& wexus::ActiveClass::fieldsMap ( void  ) [inline]

Returns all the fields as a map keyed by their field names.

Author:
Aleksander Demko
const FieldVec& wexus::ActiveClass::fieldsVec ( void  ) const [inline]

Returns all the fields as a vector.

Author:
Aleksander Demko
FieldVec& wexus::ActiveClass::fieldsVec ( void  ) [inline]

Returns all the fields as a vector.

Author:
Aleksander Demko
int wexus::ActiveClass::keyColumn ( void  ) const

Returns the index of the key column. There can only be one (for now.. anyways)

Never fails.

Author:
Aleksander Demko
std::shared_ptr<ActiveField> wexus::ActiveClass::keyField ( void  ) const [inline]

Return the ActiveField referenced by keyColumn()

Author:
Aleksander Demko
const QString& wexus::ActiveClass::questionsAsList ( void  ) const [inline]

Returns a list of question marks, each seperated by a comma. There will be as many question marks as their are fields in this class.

Author:
Aleksander Demko
const QString& wexus::ActiveClass::tableName ( void  ) const [inline]

The C++ class converted to a SQL-comptabile string (mostly :: removed)

Author:
Aleksander Demko
static QString wexus::ActiveClass::toSqlType ( const QString &  t) [static]

Converts C++ types (int QString) to SQL types.

Author:
Aleksander Demko

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Enumerator