00001 #ifndef TPPROTO_FRAMEBUILDER_H
00002 #define TPPROTO_FRAMEBUILDER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 #include <stdint.h>
00028 #include <boost/shared_ptr.hpp>
00029
00030 namespace TPProto{
00031
00032 class ProtocolLayer;
00033 class Frame;
00034 class Object;
00035 class Order;
00036 class Buffer;
00037 class OrderDescCache;
00038 class ObjectDescCache;
00039 class Command;
00040 class CommandDescCache;
00041
00047 class FrameBuilder{
00048 public:
00049 FrameBuilder();
00050 virtual ~FrameBuilder();
00051
00052 void setProtocolLayer(ProtocolLayer* pl);
00053 void setOrderDescCache(OrderDescCache* odc);
00054 void setObjectDescCache(ObjectDescCache* odc);
00055 void setCommandDescCache(CommandDescCache* cdc);
00056
00057 virtual void buildFrame(uint32_t type, Buffer* data, uint32_t ftver, uint32_t seqnum);
00058
00059 protected:
00060 void processOrderDescription(Frame* frame, Buffer* data, boost::shared_ptr<OrderDescription> od);
00061 void processObjectDescription(Frame* frame, Buffer* data, boost::shared_ptr<ObjectDescription> od);
00062 void processCommandDescription(Frame* frame, Buffer* data, boost::shared_ptr<CommandDescription> cd);
00063
00066 ProtocolLayer* layer;
00067
00070 OrderDescCache* orderdesccache;
00071
00074 ObjectDescCache* objectdesccache;
00075
00078 CommandDescCache* commanddesccache;
00079
00080 };
00081
00082 }
00083
00084 #endif