Files
rippled/Application.h
JoelKatz 639ba9dfcb NetworkOPs layer
Begin coding the 'NetworkOPs' layer. This will provide most of the
functions 'client' code will want to call such as functions to lookup
transactions, check on their status, get balances, and so on. Much of the
RPC layer will be a thin wrapper over these functions.

The purpose of this layer is to permit the node to support these functions
regardless of its operating mode or available data, as long as it's
connected to the network. If synchronized and tracking the current ledger,
it can do most functions locally. If not, it can ask for help from other
nodes. If hopeless, it can return an error code.
2011-12-15 01:19:50 -08:00

76 lines
1.5 KiB
C++

#ifndef __APPLICATION__
#define __APPLICATION__
#include "UniqueNodeList.h"
#include "ConnectionPool.h"
#include "KnownNodeList.h"
#include "TimingService.h"
#include "PubKeyCache.h"
#include "ScopedLock.h"
#include "LedgerMaster.h"
#include "Wallet.h"
#include "Peer.h"
#include "NetworkOPs.h"
#include "database/database.h"
#include <boost/asio.hpp>
class RPCDoor;
class PeerDoor;
class Application
{
NetworkOPs mNetOps;
Wallet mWallet;
TimingService mTimingService;
UniqueNodeList mUNL;
KnownNodeList mKnownNodes;
PubKeyCache mPKCache;
LedgerMaster mMasterLedger;
Database* mDatabase;
ConnectionPool mConnectionPool;
PeerDoor* mPeerDoor;
RPCDoor* mRPCDoor;
std::map<std::string, Peer::pointer> mPeerMap;
boost::recursive_mutex mPeerMapLock;
boost::asio::io_service mIOService;
boost::recursive_mutex dbLock;
public:
Application();
ConnectionPool& getConnectionPool() { return mConnectionPool; }
UniqueNodeList& getUNL() { return mUNL; }
Wallet& getWallet() { return mWallet ; }
NetworkOPs& getOPs() { return mNetOps; }
PubKeyCache& getPubKeyCache() { return mPKCache; }
boost::asio::io_service& getIOService() { return mIOService; }
LedgerMaster& getMasterLedger() { return mMasterLedger; }
ScopedLock getDBLock() { return ScopedLock(dbLock); }
void setDB(Database* db) { mDatabase=db; }
Database* getDB() { return(mDatabase); }
//Serializer* getSerializer(){ return(mSerializer); }
//void setSerializer(Serializer* ser){ mSerializer=ser; }
void run();
};
extern Application* theApp;
#endif