framebuilder.h

Go to the documentation of this file.
00001 #ifndef TPPROTO_FRAMEBUILDER_H
00002 #define TPPROTO_FRAMEBUILDER_H
00003 /*  FrameBuilder - creates frame objects from type number
00004  *
00005  *  Copyright (C) 2005, 2008  Lee Begg and the Thousand Parsec Project
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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

Generated on Tue Jan 6 04:15:47 2009 for libtpproto-cpp by  doxygen 1.5.1