Move sources to src and build objs in obj.

This commit is contained in:
Arthur Britto
2012-03-06 22:43:06 -08:00
parent 82af29a21d
commit c513e45754
95 changed files with 55 additions and 39 deletions

46
src/HashedObject.h Normal file
View File

@@ -0,0 +1,46 @@
#ifndef __HASHEDOBJECT__
#define __HASHEDOBJECT__
#include <vector>
#include <boost/shared_ptr.hpp>
#include "types.h"
#include "uint256.h"
enum HashedObjectType
{
UNKNOWN=0,
LEDGER=1,
TRANSACTION=2,
ACCOUNT_NODE=3,
TRANSACTION_NODE=4
};
class HashedObject
{
public:
typedef boost::shared_ptr<HashedObject> pointer;
HashedObjectType mType;
uint256 mHash;
uint32 mLedgerIndex;
std::vector<unsigned char> mData;
HashedObject(HashedObjectType type, uint32 index, const std::vector<unsigned char>& data) :
mType(type), mLedgerIndex(index), mData(data) { ; }
bool checkHash() const;
bool checkFixHash();
void setHash();
const std::vector<unsigned char>& getData() { return mData; }
bool store() const;
static bool store(HashedObjectType type, uint32 index, const std::vector<unsigned char>& data,
const uint256& hash);
static HashedObject::pointer retrieve(const uint256& hash);
};
#endif