TableDef Class Reference

This class represents the definition of a table. More...

#include <TableDef.h>

List of all members.

Public Member Functions

 TableDef (std::string name)
 Constructs a new TableDef with the specified name.
 ~TableDef ()
 Destructor, a noop.
cstring getName () const
 Returns the name of this table.
void addPK (const std::string &name)
 Adds a primary key with the specified name.
void addFPK (TableDefPtr table)
 Adds a foreign key to the specified table.
void addFPK (TableDefPtr table, const std::string &suffix)
 Adds a foreign key to the specified table with the specified suffix.
void addValue (const std::string &name)
 Adds an integer value with the specified name.
void addValue (const std::string &name, value_type defaultvalue)
 Adds an integer valueu with the specified name and default value.
void addTextField (const std::string &name)
 Adds a text value with the specified name.
void addLookupTextField (const std::string &name)
 Adds a text value with the specified name and provide lookup.
void addTextField (const std::string &name, const std::string &defaulttext)
 Adds a text valueu with the specified name and default value.
void addFK (TableDefPtr table)
 Adds a foreign key field.
void addFK (TableDefPtr table, const std::string &suffix)
 Adds a foreign key field with the specified suffix.
const std::string & tableForeignName () const
 Returns the foreign name of keys to this table.
FieldDefVector::const_iterator begin () const
 Returns an iterator to the first element of the FieldDef's of this table.
FieldDefVector::const_iterator end () const
 Return an iterator to the 'end' iterator of the FieldDef's of this table.
size_t size () const
 Returns the size of the FieldDef's of this table.
size_t primarykeysize () const
 Retursn the amount of primary keys this table has.


Detailed Description

This class represents the definition of a table.

Based on this class TableImpl's will be generated.

Definition at line 37 of file TableDef.h.


Constructor & Destructor Documentation

TableDef::TableDef ( std::string  name  ) 

Constructs a new TableDef with the specified name.

TableDef::~TableDef (  ) 

Destructor, a noop.


Member Function Documentation

cstring TableDef::getName (  )  const

Returns the name of this table.

void TableDef::addPK ( const std::string &  name  ) 

Adds a primary key with the specified name.

void TableDef::addFPK ( TableDefPtr  table  ) 

Adds a foreign key to the specified table.

void TableDef::addFPK ( TableDefPtr  table,
const std::string &  suffix 
)

Adds a foreign key to the specified table with the specified suffix.

void TableDef::addValue ( const std::string &  name  ) 

Adds an integer value with the specified name.

void TableDef::addValue ( const std::string &  name,
value_type  defaultvalue 
)

Adds an integer valueu with the specified name and default value.

void TableDef::addTextField ( const std::string &  name  ) 

Adds a text value with the specified name.

void TableDef::addLookupTextField ( const std::string &  name  ) 

Adds a text value with the specified name and provide lookup.

This field should at all times be unique. However, this is not enforced and as such lookups based on this fields are not guaranteed to always return the same value.

void TableDef::addTextField ( const std::string &  name,
const std::string &  defaulttext 
)

Adds a text valueu with the specified name and default value.

void TableDef::addFK ( TableDefPtr  table  ) 

Adds a foreign key field.

void TableDef::addFK ( TableDefPtr  table,
const std::string &  suffix 
)

Adds a foreign key field with the specified suffix.

const std::string& TableDef::tableForeignName (  )  const

Returns the foreign name of keys to this table.

FieldDefVector::const_iterator TableDef::begin (  )  const [inline]

Returns an iterator to the first element of the FieldDef's of this table.

Definition at line 92 of file TableDef.h.

FieldDefVector::const_iterator TableDef::end (  )  const [inline]

Return an iterator to the 'end' iterator of the FieldDef's of this table.

Definition at line 95 of file TableDef.h.

size_t TableDef::size (  )  const [inline]

Returns the size of the FieldDef's of this table.

Definition at line 98 of file TableDef.h.

size_t TableDef::primarykeysize (  )  const [inline]

Retursn the amount of primary keys this table has.

Definition at line 102 of file TableDef.h.


Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo