00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef OT_SOCKETMANAGER_H
00024 #define OT_SOCKETMANAGER_H
00025
00026
00027 class ot_socketManager : public ot_manager
00028 {
00029 private:
00030
00031 string m_hostname;
00032 int m_port;
00033 const ot_messageCodec *m_codec;
00034 ost::TCPStream *m_cSocket;
00035
00036
00037 void checkException(ot_messageBase *msg) const;
00038
00039
00040
00041 public:
00042
00043 ot_socketManager(const string &hostname,
00044 int port,
00045 int timeout=0,
00046 const ot_messageCodec *codec=ot_codecRepository::getInstance()->getStdCodec());
00047
00048 ~ot_socketManager(void);
00049
00052 void setTimeout(int timeout);
00053
00058 void callFunction(const ot_path &fPath,
00059 const ot_obj &input,
00060 auto_ptr<ot_obj> &output);
00061
00064 void dumpInterface(auto_ptr<ot_obj> &output);
00065
00067 void pingInterface(void);
00068
00073 void getAttribute(const ot_path &aPath,auto_ptr<ot_obj> &output);
00074
00079 void setAttribute(const ot_path &aPath,const ot_obj &newValue);
00080
00083 void addAttribute(const ot_path &ePath,const string &name,const ot_obj &o);
00084
00087 void removeElement(const ot_path &ePath);
00088
00091 void lockAttribute(const ot_path &aPath);
00092
00095 void unlockAttribute(const ot_path &aPath);
00096
00099 void setInterfaceAccess(const ot_path &iPath,OT_IE_ACCESS a);
00100
00103 OT_IE_STATUS getAttributeStatus(const ot_path &aPath);
00104
00108 void addInterface(const ot_path &iPath,OT_IE_ACCESS access=IE_PRIVATE);
00109
00112 void removeInterface(const ot_path &iPath);
00113
00117 void addFunction(const ot_path &iPath,ot_functionImplementation *fImpl,OT_IE_ACCESS a=IE_PRIVATE);
00118
00121 void removeFunction(const ot_path &iPath);
00122
00123 };
00124
00125 #endif