00001 /* 00002 ot_lib - Object Type Library 00003 Copyright (C) 2002 Alessandro Bonfanti 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 Alessandro Bonfanti 00020 xjbon@tin.it 00021 */ 00022 00023 00024 #ifndef OTINTERFACE_H 00025 #define OTINTERFACE_H 00026 00027 00028 #include "ot_lib.h" 00029 00030 00031 00032 // ------------------------------------------------------ 00034 00035 // ------------------------------------------------------ 00036 00037 class ot_interface 00038 { 00039 private: 00040 00041 string m_interfacePath; 00042 string m_interfaceName; 00043 interfaceRepository m_intRep; 00044 map<string,ot_interface *> m_interfaceList; 00045 OT_IE_ACCESS m_access; 00046 00047 00052 ot_interface(const string &interfacePath,const string &interfaceName,OT_IE_ACCESS access=IE_PRIVATE); 00053 00055 ~ot_interface(void); 00056 00057 00058 public: 00059 00063 void add(ot_interfaceElement *element); 00064 00068 void remove(const string &elementName); 00069 00073 ot_interfaceElement * get(const string &name); 00074 00080 void callFuction(const string &functionName,const ot_obj &input,auto_ptr<ot_obj> &output); 00081 00085 void addInterface(const string &interfaceName,OT_IE_ACCESS access); 00086 00090 void removeInterface(const string &interfaceName); 00091 00095 ot_interface * findInterface(const string &iPath); 00096 00099 const ot_map dumpInterface(void); 00100 00103 void setAccessMode(OT_IE_ACCESS access); 00104 00107 OT_IE_ACCESS getAccessMode(void) const; 00108 00111 const string getInterfaceName(void) const {return(m_interfaceName);} 00112 00115 const string getInterfacePath(void) const {return(m_interfacePath);} 00116 00117 00119 void clear(void); 00120 00121 00122 friend class ot_functionManager; 00123 }; 00124 00125 #endif