PCMNode.h

Go to the documentation of this file.
00001 
00002 //
00003 // This source file is a part of ParCompMark
00004 // Parallel Compositing Benchmark Framework
00005 //
00006 // for latest info see http://parcompmark.sourceforge.net
00007 
00008 //
00009 // Copyright (C) 2006 IT2 ParCompMark Dev. Team
00010 // 
00011 // This program is free software; you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public License
00013 // as published by the Free Software Foundation; either version 2
00014 // of the License, or (at your option) any later version.
00015 // 
00016 // This program is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 // GNU General Public License for more details.
00020 // 
00021 // You should have received a copy of the GNU General Public License
00022 // along with this program; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00024 
00027 
00028 #ifndef __PCM_NODE_H__
00029 #  define __PCM_NODE_H__
00030 
00031 //
00032 // Inner includes
00033 //
00034 
00035 #  include "PCMPremeditations.h"
00036 
00037 #  include "PCMName.h"
00038 
00039 #  include "PCMException.h"
00040 
00041 #  include "PCMLogger.h"
00042 
00043 #  include "PCMPointer.h"
00044 
00045 #  include "PCMProcess.h"
00046 
00047 #  include "PCMOutputNode.h"
00048 
00049 #  include "PCMContainer.h"
00050 
00051 #  include "PCMBuffer.h"
00052 
00053 //
00054 // Outer includes
00055 //
00056 
00057 #  include <pcapi.h>
00058 
00059 //
00060 // Scripting bind includes (for Squirrel)
00061 //
00062 
00063 #  include <squirrel/squirrel.h>
00064 #  include <squirrel/sqstdio.h>
00065 #  include <squirrel/sqstdaux.h>
00066 #  include <squirrel/sqplus.h>
00067 
00068 namespace ParCompMark
00069 {
00070 
00075   class Node:public Name
00076   {
00077 
00078         //
00079         // Unit test class
00080         //
00081 #  ifdef PARCOMPMARK_TEST
00082         friend class ParCompMarkTest::TestNode;
00083 #  endif
00084 
00085         //
00086         // Scripting binding (for Squirrel)
00087         //
00088 
00090 
00091 
00099    public:static void squirrelGlue()
00100         {
00101          ::SqPlus::SQClassDef < Node > (_T("Node")).func(&Node::createProcess,
00102                                                          _T("createProcess")).func(&Node::createBuffer,
00103                                                                                   _T("createBuffer"));
00104         }
00105 
00107 
00108         //
00109         // Typedefs
00110         //
00111 
00112    public:
00113 
00115         typedef Pointer < Node,
00116         Mutex > Pointer;
00117 
00118         //
00119         // Variables
00120         //
00121 
00123 
00124 
00125    protected:
00126 
00132         Host * mParent;
00133 
00139         PCstring mSearchPath;
00140 
00146         Container < Process, Mutex >::Pointer mProcesses;
00147 
00153         OutputNode::Pointer mOutputDocument;
00154 
00160         Container < Buffer, Mutex >::Pointer mBuffers;
00161 
00167         bool mInitialized;
00168 
00170 
00171         //
00172         // Constructors & destructor
00173         //
00174 
00176 
00177 
00178    public:
00179 
00183         Node();
00184 
00190         Node(const std::string & name, Host * parent);
00191 
00195         virtual ~ Node();
00196 
00198 
00199         //
00200         // Getters & setters
00201         //
00202 
00204 
00205 
00206    public:
00207 
00213         Host * getParent() const;
00214 
00220         const PCstring & getSearchPath() const;
00221 
00227         Container < Process, Mutex >::Pointer & getProcesses();
00228 
00234         OutputNode::Pointer & getOutputDocument();
00235 
00241         const bool & getInitialized() const;
00242 
00244 
00245         //
00246         // Methods
00247         //
00248 
00250 
00251 
00252    public:
00253 
00257         virtual void initialize();
00258 
00262         virtual void finalize();
00263 
00269         virtual Process *createProcess(const char *processName);
00270 
00281         virtual Buffer *createBuffer(const char *name, const PCuint left, const PCuint top,
00282                                   const PCuint width, const PCuint height,
00283                                   const PCuint depthFormat);
00284 
00290         virtual Buffer::Pointer getBuffer(const std::string name);
00291 
00295         virtual void start();
00296 
00301         virtual u32 stop();
00302 
00306         virtual void collectData();
00307 
00312         virtual void setFrameID(const u32 & frameID);
00313 
00315 
00316   };
00317 
00318   //
00319   // Include header implementation
00320   //
00321 
00322 #  include "PCMNode_impl.h"
00323 
00324 }
00325 
00326 // Declare Node class (and its enums) for SqPlus binding
00328 DECLARE_INSTANCE_TYPE_NAME(ParCompMark::Node, Node);
00329 
00330 #endif