$search

database_interface::DatabaseTestObject Class Reference

The C++ version of an object stored in a database. More...

#include <database_test_object.h>

Inheritance diagram for database_interface::DatabaseTestObject:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DatabaseTestObject (const DatabaseTestObject *other)
 Copy-constructs the fields based on the copied instance fields, then calls initFields().
 DatabaseTestObject ()
 Constructs the fields, then calls initFields() followed by initPermissions().
void initFields ()
 Places all the fields in the fields_ vector and sets foreign keys and sequences.
void initPermissions ()
 Initializes permissions for the fields.

Public Attributes

DBField< std::vector< char > > binary_field_
DBField< double > double_field_
DBField< int > foreign_field_
DBField< int > pk_field_
DBField< std::string > string_field_
DBField< std::vector
< std::string > > 
tags_field_

Detailed Description

The C++ version of an object stored in a database.

Note that:

Definition at line 48 of file database_test_object.h.


Constructor & Destructor Documentation

database_interface::DatabaseTestObject::DatabaseTestObject (  )  [inline]

Constructs the fields, then calls initFields() followed by initPermissions().

Note that:

  • all fields are intialized with the type, owner (this), column name and table name

Definition at line 110 of file database_test_object.h.

database_interface::DatabaseTestObject::DatabaseTestObject ( const DatabaseTestObject other  )  [inline]

Copy-constructs the fields based on the copied instance fields, then calls initFields().

The data itself in the fields, as well as the permissions, gets copied in the field copy construction.

Definition at line 127 of file database_test_object.h.


Member Function Documentation

void database_interface::DatabaseTestObject::initFields (  )  [inline]

Places all the fields in the fields_ vector and sets foreign keys and sequences.

Note that:

  • the address of the id_ field is noted as primary key
  • the addresses of all the other fields are stored in fields_
  • all the needed foreign keys are inserted for referencing fields that live in different table than out primary key
  • the sequence name used by our primary key field is noted

Definition at line 70 of file database_test_object.h.

void database_interface::DatabaseTestObject::initPermissions (  )  [inline]

Initializes permissions for the fields.

Note that:

  • default behavior is set for which fields are to be read from / written to the database. That this can always be changed later for any particular instance of this class, if you want to save or load any particular fields.

Definition at line 94 of file database_test_object.h.


Member Data Documentation

Definition at line 58 of file database_test_object.h.

Definition at line 54 of file database_test_object.h.

Definition at line 60 of file database_test_object.h.

Definition at line 52 of file database_test_object.h.

Definition at line 55 of file database_test_object.h.

Definition at line 56 of file database_test_object.h.


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


database_interface
Author(s): Matei Ciocarlie and Lorenz Mosenlechner
autogenerated on Wed Jan 16 12:14:42 2013