Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OTStorage.hpp File Reference
#include "util/Assert.hpp"
#include "containers/simple_ptr.hpp"
#include <deque>
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cstdint>
Include dependency graph for OTStorage.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  opentxs::OTDB::InitOTDBDetails
 
class  opentxs::OTDB::Storable
 
class  opentxs::OTDB::PackedBuffer
 
class  opentxs::OTDB::OTPacker
 
class  opentxs::OTDB::PackerSubclass< theBufferType >
 
class  opentxs::OTDB::Storage
 
class  opentxs::OTDB::OTDBString
 
class  opentxs::OTDB::Blob
 
class  opentxs::OTDB::StringMap
 
class  opentxs::OTDB::Displayable
 
class  opentxs::OTDB::MarketData
 
class  opentxs::OTDB::MarketList
 
class  opentxs::OTDB::OfferDataMarket
 
class  opentxs::OTDB::BidData
 
class  opentxs::OTDB::AskData
 
class  opentxs::OTDB::OfferListMarket
 
class  opentxs::OTDB::TradeDataMarket
 
class  opentxs::OTDB::TradeListMarket
 
class  opentxs::OTDB::OfferDataNym
 
class  opentxs::OTDB::OfferListNym
 
class  opentxs::OTDB::TradeDataNym
 
class  opentxs::OTDB::TradeListNym
 
class  opentxs::OTDB::Acct
 
class  opentxs::OTDB::BitcoinAcct
 
class  opentxs::OTDB::ServerInfo
 
class  opentxs::OTDB::Server
 
class  opentxs::OTDB::BitcoinServer
 
class  opentxs::OTDB::RippleServer
 
class  opentxs::OTDB::LoomServer
 
class  opentxs::OTDB::ContactNym
 
class  opentxs::OTDB::WalletData
 
class  opentxs::OTDB::ContactAcct
 
class  opentxs::OTDB::Contact
 
class  opentxs::OTDB::AddressBook
 
class  opentxs::OTDB::StorageFS
 

Namespaces

 opentxs
 
 opentxs::OTDB
 
 opentxs::OTDB::details
 

Macros

#define OTDB_PROTOCOL_BUFFERS   1
 
#define OTDB_DEFAULT_PACKER   OTDB::PACK_PROTOCOL_BUFFERS
 
#define OTDB_DEFAULT_STORAGE   OTDB::STORE_FILESYSTEM
 
#define OTInterface   class
 
#define DeclareInterface(name)
 
#define DeclareBasedInterface(name, base)
 
#define EndInterface
 
#define implements   public
 
#define DEFINE_OT_DYNAMIC_CAST(CLASS_NAME)
 
#define DECLARE_PACKED_BUFFER_SUBCLASS(theNewType, thePackerType,theInterfaceType, theInternalType)
 
#define DECLARE_GET_ADD_REMOVE(name)
 
#define OT_USING_ISTORABLE_HOOKS
 

Typedefs

typedef Storable *( opentxs::OTDB::InstantiateFunc )()
 
typedef std::pair< PackType,
StoredObjectType > 
opentxs::OTDB::InstantiateFuncKey
 
typedef std::map
< InstantiateFuncKey,
InstantiateFunc * > 
opentxs::OTDB::mapOfFunctions
 

Enumerations

enum  opentxs::OTDB::PackType { opentxs::OTDB::PACK_MESSAGE_PACK = 0, opentxs::OTDB::PACK_PROTOCOL_BUFFERS, opentxs::OTDB::PACK_TYPE_ERROR }
 
enum  opentxs::OTDB::StorageType { opentxs::OTDB::STORE_FILESYSTEM = 0, opentxs::OTDB::STORE_TYPE_SUBCLASS }
 
enum  opentxs::OTDB::StoredObjectType {
  opentxs::OTDB::STORED_OBJ_STRING = 0, opentxs::OTDB::STORED_OBJ_BLOB, opentxs::OTDB::STORED_OBJ_STRING_MAP, opentxs::OTDB::STORED_OBJ_WALLET_DATA,
  opentxs::OTDB::STORED_OBJ_BITCOIN_ACCT, opentxs::OTDB::STORED_OBJ_BITCOIN_SERVER, opentxs::OTDB::STORED_OBJ_RIPPLE_SERVER, opentxs::OTDB::STORED_OBJ_LOOM_SERVER,
  opentxs::OTDB::STORED_OBJ_SERVER_INFO, opentxs::OTDB::STORED_OBJ_CONTACT_NYM, opentxs::OTDB::STORED_OBJ_CONTACT_ACCT, opentxs::OTDB::STORED_OBJ_CONTACT,
  opentxs::OTDB::STORED_OBJ_ADDRESS_BOOK, opentxs::OTDB::STORED_OBJ_MARKET_DATA, opentxs::OTDB::STORED_OBJ_MARKET_LIST, opentxs::OTDB::STORED_OBJ_BID_DATA,
  opentxs::OTDB::STORED_OBJ_ASK_DATA, opentxs::OTDB::STORED_OBJ_OFFER_LIST_MARKET, opentxs::OTDB::STORED_OBJ_TRADE_DATA_MARKET, opentxs::OTDB::STORED_OBJ_TRADE_LIST_MARKET,
  opentxs::OTDB::STORED_OBJ_OFFER_DATA_NYM, opentxs::OTDB::STORED_OBJ_OFFER_LIST_NYM, opentxs::OTDB::STORED_OBJ_TRADE_DATA_NYM, opentxs::OTDB::STORED_OBJ_TRADE_LIST_NYM,
  opentxs::OTDB::STORED_OBJ_ERROR
}
 

Functions

 opentxs::OTDB::DeclareInterface (IStorable) virtual bool onPack(PackedBuffer &theBuffer
 
virtual bool opentxs::OTDB::onUnpack (PackedBuffer &theBuffer, Storable &outObj)=0
 
virtual void opentxs::OTDB::hookBeforePack ()
 
virtual void opentxs::OTDB::hookAfterUnpack ()
 
EXPORT bool opentxs::OTDB::InitDefaultStorage (StorageType eStoreType, PackType ePackType)
 
EXPORT Storage * opentxs::OTDB::GetDefaultStorage ()
 
EXPORT Storage * opentxs::OTDB::CreateStorageContext (StorageType eStoreType, PackType ePackType=OTDB_DEFAULT_PACKER)
 
EXPORT Storable * opentxs::OTDB::CreateObject (StoredObjectType eType)
 
EXPORT bool opentxs::OTDB::CheckStringsExistInOrder (std::string &strFolder, std::string &oneStr, std::string &twoStr, std::string &threeStr, const char *szFuncName=nullptr)
 
EXPORT bool opentxs::OTDB::Exists (std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 
EXPORT int64_t opentxs::OTDB::FormPathString (std::string &strOutput, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 
EXPORT bool opentxs::OTDB::StoreString (std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 
EXPORT std::string opentxs::OTDB::QueryString (std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 
EXPORT bool opentxs::OTDB::StorePlainString (std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 
EXPORT std::string opentxs::OTDB::QueryPlainString (std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 
EXPORT bool opentxs::OTDB::StoreObject (Storable &theContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 
EXPORT Storable * opentxs::OTDB::QueryObject (StoredObjectType theObjectType, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 
EXPORT std::string opentxs::OTDB::EncodeObject (Storable &theContents)
 
EXPORT Storable * opentxs::OTDB::DecodeObject (StoredObjectType theObjectType, std::string strInput)
 
EXPORT bool opentxs::OTDB::EraseValueByKey (std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
 

Variables

const char * opentxs::OTDB::StoredObjectTypeStrings []
 
OTDB::Storage * opentxs::OTDB::details::s_pStorage = nullptr
 
OTDB::mapOfFunctions * opentxs::OTDB::details::pFunctionMap
 
Storable & opentxs::OTDB::inObj = 0
 

Macro Definition Documentation

#define DECLARE_GET_ADD_REMOVE (   name)
Value:
protected: \
std::deque<stlplus::simple_ptr_clone<name>> list_##name##s; \
\
public: \
EXPORT size_t Get##name##Count(); \
EXPORT name* Get##name(size_t nIndex); \
EXPORT bool Remove##name(size_t nIndex##name); \
EXPORT bool Add##name(name& disownObject)

Definition at line 893 of file OTStorage.hpp.

#define DECLARE_PACKED_BUFFER_SUBCLASS (   theNewType,
  thePackerType,
  theInterfaceType,
  theInternalType 
)
Value:
class theNewType : public PackedBuffer \
{ \
friend class thePackerType; \
friend OTInterface theInterfaceType; \
theInternalType m_buffer; \
\
public: \
theNewType() \
: PackedBuffer() \
{ \
} \
virtual ~theNewType() \
{ \
} \
virtual bool PackString(std::string& theString); \
virtual bool UnpackString(std::string& theString); \
virtual bool ReadFromIStream(std::istream& inStream, \
int64_t lFilesize); \
virtual bool WriteToOStream(std::ostream& outStream); \
virtual const uint8_t* GetData(); \
virtual size_t GetSize(); \
virtual void SetData(const uint8_t* pData, size_t theSize); \
theInternalType& GetBuffer() \
{ \
return m_buffer; \
} \
}
#define OTInterface
Definition: OTStorage.hpp:185

Definition at line 506 of file OTStorage.hpp.

#define DeclareBasedInterface (   name,
  base 
)
Value:
class name : public base \
{ \
public: \
virtual ~name() \
{ \
}

Definition at line 195 of file OTStorage.hpp.

#define DeclareInterface (   name)
Value:
{ \
public: \
virtual ~name() \
{ \
}
#define OTInterface
Definition: OTStorage.hpp:185

Definition at line 187 of file OTStorage.hpp.

#define DEFINE_OT_DYNAMIC_CAST (   CLASS_NAME)
Value:
virtual CLASS_NAME* clone() const \
{ \
std::cout \
<< "********* THIS SHOULD NEVER HAPPEN!!!!! *****************" \
<< std::endl; \
} \
static CLASS_NAME* ot_dynamic_cast(Storable* pObject) \
{ \
return dynamic_cast<CLASS_NAME*>(pObject); \
}
#define OT_FAIL
Definition: Assert.hpp:139

Definition at line 414 of file OTStorage.hpp.

#define EndInterface
Value:
} \
;

Definition at line 203 of file OTStorage.hpp.

#define implements   public

Definition at line 207 of file OTStorage.hpp.

#define OT_USING_ISTORABLE_HOOKS
Value:
virtual void hookAfterUnpack()
Definition: OTStorage.hpp:384
virtual void hookBeforePack()
Definition: OTStorage.hpp:380

Definition at line 1967 of file OTStorage.hpp.

#define OTDB_DEFAULT_PACKER   OTDB::PACK_PROTOCOL_BUFFERS

Definition at line 167 of file OTStorage.hpp.

#define OTDB_DEFAULT_STORAGE   OTDB::STORE_FILESYSTEM

Definition at line 169 of file OTStorage.hpp.

#define OTDB_PROTOCOL_BUFFERS   1

#define OTDB_MESSAGE_PACK 1 // Note: deactivating MsgPack for now, since we don't use it, and since I don't want to have to add it to the Android NDK build.

Definition at line 163 of file OTStorage.hpp.

#define OTInterface   class

Definition at line 185 of file OTStorage.hpp.