mongo::Model Class Reference

#include <model.h>

List of all members.

Public Member Functions

virtual void append (const char *name, BSONObjBuilder &b)
virtual const char * getNS ()=0
virtual bool load (BSONObj &query)
 Model ()
virtual string modelServer ()=0
virtual void remove (bool safe=false)
virtual void save (bool safe=false)
virtual void serialize (BSONObjBuilder &to)=0
virtual BSONObj toObject ()
virtual void unserialize (const BSONObj &from)=0
virtual ~Model ()

Protected Attributes

BSONObj _id

Detailed Description

Model is a base class for defining objects which are serializable to the Mongo database via the database driver.

Definition Your serializable class should inherit from Model and implement the abstract methods below.

Loading To load, first construct an (empty) object. Then call load(). Do not load an object more than once.

Definition at line 36 of file model.h.


Constructor & Destructor Documentation

mongo::Model::Model (  )  [inline]

Definition at line 38 of file model.h.

virtual mongo::Model::~Model (  )  [inline, virtual]

Definition at line 39 of file model.h.


Member Function Documentation

virtual void mongo::Model::append ( const char *  name,
BSONObjBuilder b 
) [virtual]
virtual const char* mongo::Model::getNS (  )  [pure virtual]
virtual bool mongo::Model::load ( BSONObj query  )  [virtual]

Load a single object.

Returns:
true if successful.
virtual string mongo::Model::modelServer (  )  [pure virtual]
virtual void mongo::Model::remove ( bool  safe = false  )  [virtual]
virtual void mongo::Model::save ( bool  safe = false  )  [virtual]
virtual void mongo::Model::serialize ( BSONObjBuilder to  )  [pure virtual]
virtual BSONObj mongo::Model::toObject (  )  [virtual]
virtual void mongo::Model::unserialize ( const BSONObj from  )  [pure virtual]

Member Data Documentation

Definition at line 57 of file model.h.


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


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:56 2013