00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef OPT_H
00023 #define OPT_H
00024
00025 #include "SmartPtr.h"
00026 #include "Container.h"
00027 #include "DUID.h"
00028
00029 class TMsg;
00030
00031 class TOpt
00032 {
00033 public:
00034 TOpt(int optType, TMsg* parent);
00035 virtual ~TOpt();
00036
00037 virtual int getSize() = 0;
00038 virtual char * storeSelf(char* buf) = 0;
00039 virtual bool doDuties() = 0;
00040 virtual bool isValid();
00041 int getOptType();
00042 int getSubOptSize();
00043
00044 char* TOpt::storeSubOpt(char* buf);
00045 SmartPtr<TOpt> getOption(int optType);
00046
00047
00048 void firstOption();
00049 SmartPtr<TOpt> getOption();
00050 void addOption(SmartPtr<TOpt> opt);
00051 int countOption();
00052 void setParent(TMsg* Parent);
00053
00054 SmartPtr<TDUID> getDUID();
00055 void setDUID(SmartPtr<TDUID> duid);
00056
00057 protected:
00058 TContainer< SmartPtr<TOpt> > SubOptions;
00059 int OptType;
00060 TMsg* Parent;
00061 SmartPtr<TDUID> DUID;
00062 };
00063
00064 #endif
00065