mongo::Model Class Reference
#include <model.h>
List of all members.
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] |
virtual mongo::Model::~Model |
( |
|
) |
[inline, virtual] |
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
The documentation for this class was generated from the following file: