Skip to content

cnsuhao/Mongo-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helium Game Engine

Mongo completely automates the serialization of an object to and from a MongoDB database. The Reflect C++ reflection library provides information about the member variable layout of a class of object. Model objects contain only a single new member variable: id, which follows the _id variable that stores the internal unique id of an object in MongoDB.

Design

This module was written to implement the database modelling design pattern in C++ using reflection information provided by Reflect. At the moment its focused on correctly serializing C++ classes to and from BSON within the context of a database connection. Queries and indexes must be implemented outside the scope of this module. Inserts are only valid using a model object with a null id, and Updates are only valid with a model object with a non-null id.

Implementation

Mongo was written to not rely on locks when accessing the database. Mongo::Database merely tracks which thread is intended to use the database connection, and it will assert if the wrong thread causes the connection to be used.

Location

https://github.com/HeliumProject/Mongo

About

Mongo db driver using C++ reflection for database models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.8%
  • C 2.2%