00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __COLCOWS_OBJECT_DESC_HH__
00028 #define __COLCOWS_OBJECT_DESC_HH__
00029
00030
00031 #include "ColCOWS_Include.hh"
00032 #include "ColCOWS_Debug.hh"
00033
00034
00035 namespace CORBA {
00036 class Object;
00037 }
00038
00039 __COLCOWS_BEGIN__
00040
00041
00042
00043 class ObjectDesc
00044 {
00045
00046 public:
00047
00048 ObjectDesc() {}
00049
00050
00051 ObjectDesc(std::string id, std::string kind, CORBA::Object * ref) :
00052 obj_id(id), obj_kind(kind), obj_ref(ref) {}
00053
00054
00055 virtual ~ObjectDesc() {}
00056
00057
00058 inline virtual void printself(std::ostream & stream, int indent = 0) const
00059 {
00060 std::string space;
00061 for(int i = 0; i < indent; i++, space += COLCOWS_TAB);
00062 stream << space << std::flush;
00063 stream << " ID: " << obj_id << std::flush;
00064 stream << " kind: " << obj_kind << std::flush;
00065 }
00066
00067
00068 public:
00069
00070
00071 std::string obj_id;
00072
00073
00074 std::string obj_kind;
00075
00076
00077 CORBA::Object * obj_ref;
00078
00079 };
00080
00081
00082 class ExtObjectDesc : public ObjectDesc
00083 {
00084
00085 public:
00086
00087 ExtObjectDesc() {}
00088
00089
00090 ExtObjectDesc(ObjectDesc obj_desc) : ObjectDesc(obj_desc) {}
00091
00092
00093 virtual ~ExtObjectDesc() {}
00094
00095
00096 inline virtual void printself(std::ostream & stream, int indent = 0) const
00097 {
00098 ObjectDesc::printself( stream, indent);
00099 stream << " Num Connection: " << num_connection << std::flush;
00100 stream << " Num Node: " << num_node << std::flush;
00101 }
00102
00103 public:
00104
00105
00106 unsigned long num_connection;
00107
00108
00109 unsigned long num_node;
00110
00111 };
00112
00113 typedef std::vector< ExtObjectDesc > ExtObjectDescVec;
00114
00115
00116
00117
00118 inline std::ostream & operator <<(std::ostream & stream, const ObjectDesc & _this)
00119 {
00120 stream << "ObjectDesc { " << std::flush;
00121 _this.printself(stream);
00122 stream << "}" << std::flush;
00123 return stream;
00124 }
00125
00126
00127
00128
00129 inline std::ostream & operator <<(std::ostream & stream, const ExtObjectDesc & _this)
00130 {
00131 stream << "ExtObjectDesc { " << std::flush;
00132 _this.printself(stream);
00133 stream << "}" << std::flush;
00134 return stream;
00135 }
00136
00137
00138
00139 __COLCOWS_END__
00140
00141 #endif // __COLCOWS_NODE_DESC_HH__
00142
00143
00144