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 OT_IOR_H 00025 #define OT_IOR_H 00026 00027 // ----------------------------------------------------------------------------------- 00029 00030 // ----------------------------------------------------------------------------------- 00031 00032 class ot_ior : public ot_obj 00033 { 00034 public: 00035 typedef enum {NULL_IOR,INTERFACE,FUNCTION,ATTRIBUTE} IORTYPE; 00036 00037 00038 private: 00039 00040 string m_host; 00041 int m_port; 00042 IORTYPE m_type; 00043 string m_iPath; 00044 00045 00046 public: 00047 00048 00049 00050 // ######################################### 00051 // CONSTRUCTORS & DESTRUCTOR 00052 // ######################################### 00053 00055 ot_ior(void); 00056 00058 ot_ior(const string &host,int port,IORTYPE type,const string &iPath); 00059 00062 ot_ior(const ot_ior &c); 00063 00065 virtual ~ot_ior(void); 00066 00067 00068 // ######################################### 00069 // IMPLEMENTATIONS OF THE VIRTUAL FUNCTIONS 00070 // ######################################### 00071 00075 ot_obj *dup(void) const; 00076 00080 void asXml(ostream &s=cout,int i=0) const; 00081 00084 bool asData(ostream &s) const; 00085 00086 00087 // ######################################### 00088 // PROPIETARY FUNCTIONS 00089 // ######################################### 00090 00091 00093 00094 const string & getHost(void) const; 00095 int getPort(void) const; 00096 const string & getInterfacePath(void) const; 00097 IORTYPE getIORType(void) const; 00098 00099 static ot_ior null(void); 00100 00101 // ######################################### 00102 // MATH OPERATOR 00103 // ######################################### 00104 00106 ot_ior & operator = (const ot_ior &c); 00107 00109 bool operator == (const ot_ior &c) const; 00110 00112 bool operator != (const ot_ior &v); 00113 00115 bool operator == (const ot_obj *o) const 00116 { 00117 if(o && o->getType()==getType()) return(*this==*((ot_ior *) o)); 00118 else return(false); 00119 } 00120 00121 }; 00122 00123 #endif