CCAFFEINE  0.8.8
UserPortData.h
00001 #ifndef dc_fwk_UserPortData_h_seen
00002 #define dc_fwk_UserPortData_h_seen
00003 
00004 #include <vector>
00005 #include <string>
00006 
00012 #define UserPortData_USEEXPLICIT_COPYCTOR 0
00013 
00019 class UserPortData 
00020 {
00021 
00022 private:
00023   // ::ccafeopq::Port *pp; on connectionid, not here.
00024   ::ccafeopq::TypeMap_shared tm;
00025   ::std::string name;
00026   ::std::string type;
00027   int serial;
00028   bool isActive;
00029   bool isSelfConnected;
00030   void shutdown();
00031   ::std::vector< ConnectionID_ptr >conns;
00032 
00033   friend class Gizzard;
00034 
00035 public:
00036 
00037   UserPortData();
00038 #if UserPortData_USEEXPLICIT_COPYCTOR
00039   UserPortData(const UserPortData & src);
00040 #endif
00041 
00046   UserPortData(const ::std::string & name_, const ::std::string & type_, ::ccafeopq::TypeMap_shared & tm_, int serial); 
00047 
00048   virtual ~UserPortData();
00049 
00051   ::ccafeopq::TypeMap_shared getUserPortProperties();
00052 
00053   void setUserPortProperties( ::ccafeopq::TypeMap_shared tm_);
00054 
00055   ::std::string getPortName() const;
00056   ::std::string getPortType() const;
00057   bool getIsActive();
00058   bool getIsConnected();
00059 
00060   const ::std::vector< ConnectionID_ptr > & getConnectionIDs() const;
00061 
00062   ConnectionID_ptr addConnection(Gizzard *user, const ::std::string & uname, Gizzard *provider, const ::std::string & pname, ::ccafeopq::Port *p);
00063 
00064   ConnectionID_ptr addSelfConnection(Gizzard *user, const ::std::string & uname, ::ccafeopq::Port *p);
00065 
00067   int removeConnection(ConnectionID_ptr & cp);
00069   int removeConnections();
00070 
00071   int getNumberOfConnections();
00072   int getMaxConnections();
00073   int getMinConnections();
00074 
00075  // convenience methods...
00076 
00077   // updates isActive.
00078   ::ccafeopq::Port *getProvided();
00079   void releaseProvided();
00080 
00081   ::std::vector< ::ccafeopq::Port * > getAllProvided();
00082   void releaseAllProvided();
00083 
00084   ::std::string toString() const;
00085 
00086   static void initDefaultProperties( ::ccafeopq::TypeMap_shared t,
00087                  const std::string &name, const std::string & type );
00088 
00089 };
00090 
00091 #endif // dc_fwk_UserPortData_h_seen