00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __Edge_AMOS_HH
00011 #define __Edge_AMOS_HH 1
00012
00013 #include "Link_AMOS.hh"
00014 #include <vector>
00015
00016
00017
00018
00019 namespace AMOS {
00020
00021
00024
00025 class IEdge_t
00026 {
00027
00028 private:
00029
00030 std::vector<ID_t> links_m;
00031
00032
00033 protected:
00034
00035
00036 virtual void readRecord (std::istream & fix, std::istream & var);
00037
00038
00039
00040 virtual void readRecordFix (std::istream & fix);
00041
00042
00043
00044 virtual void writeRecord (std::ostream & fix, std::ostream & var) const;
00045
00046
00047 public:
00048
00049
00052 IEdge_t ( )
00053 {
00054
00055 }
00056
00057
00058
00061 IEdge_t (const IEdge_t & source)
00062 {
00063 *this = source;
00064 }
00065
00066
00067
00070 virtual ~IEdge_t ( )
00071 {
00072
00073 }
00074
00075
00076
00077 void clear ( )
00078 {
00079 links_m . clear( );
00080 }
00081
00082
00083
00088 const std::vector<ID_t> & getLinks ( ) const
00089 {
00090 return links_m;
00091 }
00092
00093
00094
00099 std::vector<ID_t> & getLinks ( )
00100 {
00101 return links_m;
00102 }
00103
00104
00105
00106 virtual NCode_t getNCode ( ) const = 0;
00107
00108
00109
00110 virtual void readMessage (const Message_t & msg);
00111
00112
00113
00119 void setLinks (const std::vector<ID_t> & links)
00120 {
00121 links_m = links;
00122 }
00123
00124
00125
00126 virtual void writeMessage (Message_t & msg) const;
00127
00128 };
00129
00130
00131
00132
00133
00139
00140 class Edge_t : public Link_t, public IEdge_t
00141 {
00142
00143 private:
00144
00145
00146 protected:
00147
00148
00149 virtual void readRecord (std::istream & fix, std::istream & var);
00150
00151
00152
00153 virtual void readRecordFix (std::istream & fix);
00154
00155
00156
00157 virtual void writeRecord (std::ostream & fix, std::ostream & var) const;
00158
00159
00160 public:
00161
00162 static const NCode_t NCODE;
00164
00165
00166
00169 Edge_t ( )
00170 {
00171
00172 }
00173
00174
00175
00178 Edge_t (const Edge_t & source)
00179 {
00180 *this = source;
00181 }
00182
00183
00184
00187 ~Edge_t ( )
00188 {
00189
00190 }
00191
00192
00193
00194 virtual void clear ( )
00195 {
00196 Link_t::clear( );
00197 IEdge_t::clear( );
00198 }
00199
00200
00201
00202 virtual NCode_t getNCode ( ) const
00203 {
00204 return Edge_t::NCODE;
00205 }
00206
00207
00208
00209 virtual void readMessage (const Message_t & msg);
00210
00211
00212
00213 virtual void writeMessage (Message_t & msg) const;
00214
00215 };
00216
00217 }
00218
00219 #endif // #ifndef __Edge_AMOS_HH