LargeCarrot.h

00001 
00002 #ifndef LESTER_LARGECARROT_H
00003 #define LESTER_LARGECARROT_H
00004 
00005 #include "Rabbit.hh"
00006 #include <ipc/object.h>
00007 #include <ipc/server.h>
00008 #include <vector>
00009 #include "LargeOnion.h"
00010 
00011 class LargeCarrot :
00012  public IPCNamedObject<POA_Stew::Carrot, ipc::multi_thread>, // The important part.
00013  public IPCServer {                // We fancy calling a blocking "run()" method or and unblocking "stop()" method.
00014   
00015  public:
00016   LargeCarrot() : 
00017     IPCNamedObject<POA_Stew::Carrot, ipc::multi_thread>(IPCPartition("SCT"),
00018                                                         "LargeCarrotName") {
00019     m_gobble = new std::vector<int>(1000000);
00020     (*m_gobble)[976424]=234;
00021     std::cout << "Publishing LargeCarrot ..." << std::endl;
00022     publish();
00023   };
00024 
00025  public:
00026   virtual Stew::Onion_ptr anOnion() {
00027     static LargeOnion largeOnion;
00028     return largeOnion._this();
00029   };
00030   
00031  public:
00032   virtual void shutdown() {
00033     std::cout << "I was asked to shut my LargeCarrot down!" << std::endl;
00034     stop();
00035   };
00036 
00037  public:
00038   ~LargeCarrot() {
00039     std::cout << "~LargeCarrot()" << std::endl;
00040     delete m_gobble;
00041   };
00042 
00043  private:
00044   std::vector<int> * m_gobble;
00045 
00046 };
00047 
00048 #endif 

Generated on Mon Feb 6 14:01:22 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6