GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
GoDBNameDescRow Class Referenceabstract

Abstract. manages the map with the keys matching the fields for the DBtable containing a name and description fields. More...

#include <Code/IO/GoDBRow/GoDBNameDescRow.h>

Inheritance diagram for GoDBNameDescRow:
Inheritance graph
[legend]
Collaboration diagram for GoDBNameDescRow:
Collaboration graph
[legend]

Public Member Functions

virtual int DoesThisEntityAlreadyExists (vtkMySQLDatabase *iDatabaseConnector)=0
 Pure Virtual :check if the entity already exists in the database based on its own uniqueness definition, return the ID of the entity already existing or -1 if not yet created. More...
 
virtual int DoesThisEntityAlreadyExistsAndReturnName (vtkMySQLDatabase *iDatabaseConnector, std::string &ioName)
 check if the entity already exists in the database based on its own uniqueness definition, return the ID of the entity already exiting or -1 if not yet created and change the ioName with the name of the existing entity More...
 
virtual int DoesThisNameAlreadyExists (vtkMySQLDatabase *iDatabaseConnector)
 check if the name already exists in the database, if yes, return the corresponding ID, if not -1 More...
 
 GoDBNameDescRow ()
 
virtual int SaveInDB (vtkMySQLDatabase *iDatabaseConnector)=0
 Pure Virtual :check if the entity already exists in the DB, if yes, return the existing ID, if not, save it in the DB and return the ID for the new created entity. More...
 
 ~GoDBNameDescRow ()
 
- Public Member Functions inherited from GoDBRow
StringMapConstIterator ConstMapBegin ()
 
StringMapConstIterator ConstMapEnd ()
 
void DeleteFromDB (vtkMySQLDatabase *iDatabaseConnector)
 delete from the database the row which has the same TableID More...
 
std::string GetMapValue (const std::string &key)
 return the value for the field map[key] after having removed the " at the beginning and at the end of the value if it is a string in order to get the original value. More...
 
template<typename T >
GetMapValue (const std::string &key)
 
std::string GetTableIDName ()
 
std::string GetTableName ()
 
std::vector< std::string > GetVectorColumnNames ()
 put all the keys of the map in a vector More...
 
 GoDBRow ()
 
StringMapIterator MapBegin ()
 
StringMapIterator MapEnd ()
 
std::string PrintColumnNames ()
 put all the keys of the map in a string separated by ',' More...
 
std::string PrintColumnNamesWithValues ()
 put all the keys and values of the map in a string as map[key] = value separated by ',' More...
 
std::vector< std::string > PrintColumnsAndValues ()
 
std::string PrintValues ()
 put all the values of the map in a string separated by ',' More...
 
template<typename T >
void SetField (const std::string &key, const T &value)
 convert the value into a string and assign it to the key in the map More...
 
void SetField (const std::string &key, const std::string &value)
 set value as the value of map[key] after having put " at the beginning and at the end of the string, as value is a string and it will be needed for the database queries. map[key] = " "value" " More...
 
virtual bool SetValuesForSpecificID (int ID, vtkMySQLDatabase *iDatabaseConnector)
 get the data from the database corresponding to the specific ID and put them in the map More...
 
virtual ~GoDBRow ()
 

Protected Member Functions

virtual void InitializeMap ()
 virtual pure. initialize all the values of the map More...
 
template<typename T >
int SaveInDBTemplate (vtkMySQLDatabase *iDatabaseConnector, T iNewEntity)
 check if the GoDBNameDescRow already exists, if yes, return the ID of the existing one, if not, save it in the database and return the new ID More...
 
- Protected Member Functions inherited from GoDBRow
void AddConditions (const std::string &iNameOfField, std::vector< FieldWithValue > &ioFieldWithValue)
 add as an element of ioFieldWithValue the name and value of the map with the key iNameOfField More...
 

Additional Inherited Members

- Public Types inherited from GoDBRow
typedef
StringMapType::const_iterator 
StringMapConstIterator
 
typedef StringMapType::iterator StringMapIterator
 
typedef std::map< std::string,
std::string > 
StringMapType
 
- Protected Attributes inherited from GoDBRow
StringMapType m_MapRow
 
std::string m_TableIDName
 
std::string m_TableName
 

Detailed Description

Abstract. manages the map with the keys matching the fields for the DBtable containing a name and description fields.

Definition at line 47 of file GoDBNameDescRow.h.

Constructor & Destructor Documentation

GoDBNameDescRow::GoDBNameDescRow ( )

Definition at line 39 of file GoDBNameDescRow.cxx.

GoDBNameDescRow::~GoDBNameDescRow ( )
inline

Definition at line 52 of file GoDBNameDescRow.h.

Member Function Documentation

virtual int GoDBNameDescRow::DoesThisEntityAlreadyExists ( vtkMySQLDatabase *  iDatabaseConnector)
pure virtual

Pure Virtual :check if the entity already exists in the database based on its own uniqueness definition, return the ID of the entity already existing or -1 if not yet created.

Parameters
[in]iDatabaseConnectorconnection to the database
Returns
int existing ID or -1 if the entity doesn't exists

Implemented in GoDBBookmarkRow, GoDBColorRow, GoDBSubCellTypeRow, and GoDBCellTypeRow.

int GoDBNameDescRow::DoesThisEntityAlreadyExistsAndReturnName ( vtkMySQLDatabase *  iDatabaseConnector,
std::string &  ioName 
)
virtual

check if the entity already exists in the database based on its own uniqueness definition, return the ID of the entity already exiting or -1 if not yet created and change the ioName with the name of the existing entity

Parameters
[in]iDatabaseConnectorconnection to the database
[in,out]ioNamemodified if the entity already exists with the name of the existing entity
Returns
int existing ID or -1 if the entity doesn't exists

Definition at line 70 of file GoDBNameDescRow.cxx.

int GoDBNameDescRow::DoesThisNameAlreadyExists ( vtkMySQLDatabase *  iDatabaseConnector)
virtual

check if the name already exists in the database, if yes, return the corresponding ID, if not -1

Parameters
[in]iDatabaseConnectorconnection to the database
Returns
int return the ID of the existing entity with the same name or -1 if no entity has the same name

Reimplemented in GoDBBookmarkRow.

Definition at line 60 of file GoDBNameDescRow.cxx.

void GoDBNameDescRow::InitializeMap ( )
protectedvirtual

virtual pure. initialize all the values of the map

Implements GoDBRow.

Reimplemented in GoDBBookmarkRow, GoDBColorRow, GoDBSubCellTypeRow, and GoDBCellTypeRow.

Definition at line 47 of file GoDBNameDescRow.cxx.

virtual int GoDBNameDescRow::SaveInDB ( vtkMySQLDatabase *  iDatabaseConnector)
pure virtual

Pure Virtual :check if the entity already exists in the DB, if yes, return the existing ID, if not, save it in the DB and return the ID for the new created entity.

Parameters
[in]iDatabaseConnectorconnection to the database
Returns
int existing or new created ID for the entity

Implemented in GoDBBookmarkRow, GoDBColorRow, GoDBSubCellTypeRow, and GoDBCellTypeRow.

template<typename T >
int GoDBNameDescRow::SaveInDBTemplate ( vtkMySQLDatabase *  iDatabaseConnector,
iNewEntity 
)
inlineprotected

check if the GoDBNameDescRow already exists, if yes, return the ID of the existing one, if not, save it in the database and return the new ID

Parameters
[in]iDatabaseConnectorconnection to the database
[in]iNewEntitynew entity to be saved
Template Parameters
iNewEntitychildren of NameDescRow

Definition at line 107 of file GoDBNameDescRow.h.


The documentation for this class was generated from the following files: