Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

InterfaceDef.h

Go to the documentation of this file.
00001 //                            Package   : omniIFR
00002 //  InterfaceDef.h            Created   : 2004/02/22
00003 //                            Author    : Alex Tingle
00004 //
00005 //    Copyright (C) 2004 Alex Tingle.
00006 //
00007 //    This file is part of the omniIFR application.
00008 //
00009 //    omniIFR is free software; you can redistribute it and/or
00010 //    modify it under the terms of the GNU Lesser General Public
00011 //    License as published by the Free Software Foundation; either
00012 //    version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //    omniIFR is distributed in the hope that it will be useful,
00015 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //    Lesser General Public License for more details.
00018 //
00019 //    You should have received a copy of the GNU Lesser General Public
00020 //    License along with this library; if not, write to the Free Software
00021 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 #ifndef OMNIIFR__INTERFACEDEF_H
00024 #define OMNIIFR__INTERFACEDEF_H
00025 
00026 #include "Container.h"
00027 #include "Contained.h"
00028 #include "idltype.h"
00029 #include "Dependency.h"
00030 #include <string>
00031 #include <set>
00032 
00033 namespace Omniifr {
00034 
00035 class Container_impl; 
00036 class Repository_impl;
00037 
00038 class InterfaceDef_impl :
00039   public virtual POA_CORBA::InterfaceDef,
00040   public         Container_impl,
00041   public         Contained_impl,
00042   public         IDLType_impl
00043 {
00044 public: // CORBA attributes
00045   InterfaceDefSeq* base_interfaces();
00046   void             base_interfaces(const InterfaceDefSeq& v);
00047 public: // CORBA interface methods
00048   Boolean is_a(const char* interface_id);
00049   CORBA::InterfaceDef::FullInterfaceDescription* describe_interface();
00050   AttributeDef_ptr create_attribute(
00051     const char*   id,
00052     const char*   name,
00053     const char*   version,
00054     IDLType_ptr   type,
00055     AttributeMode mode
00056   );
00057   OperationDef_ptr create_operation(
00058     const char*              id,
00059     const char*              name,
00060     const char*              version,
00061     IDLType_ptr              result,
00062     OperationMode            mode,
00063     const ParDescriptionSeq& params,
00064     const ExceptionDefSeq&   exceptions,
00065     const ContextIdSeq&      contexts
00066   );
00067 public: // CORBA interface methods (from IRObject)
00068   DefinitionKind def_kind(){return CORBA::dk_Interface;}
00069 public: // CORBA interface methods (from Container)
00070   ContainedSeq* contents(DefinitionKind limit_type, Boolean exclude_inherited);
00071 public: // CORBA interface methods (from Contained)
00072   CORBA::Contained::Description* describe();
00073 public: // CORBA attributes (from IDLType)
00074   TypeCode_ptr type();
00075 
00076 private:
00077   Dependency2<InterfaceDefSeq> _base_interfaces;
00078 
00079 public:
00080   InterfaceDef_impl():_base_interfaces(this){}
00081   virtual ~InterfaceDef_impl() {}
00082   void uncheckedDestroy();
00083   bool canContain(DefinitionKind kind);
00084   void reincarnate(const PersistNode& node);
00085   void output(ostream &os);
00086 
00087 private:
00089   RepositoryIdSeq baseInterfacesIds();
00090 
00095   void checkInheritedNameClash(const char* name);
00096 
00098   struct NoCaseStringOrdering
00099   {
00100     bool operator()(string s1, string s2) const
00101     {
00102       return( strcasecmp(s1.c_str(),s2.c_str())<0 );
00103     }
00104   };
00105 
00106   typedef set<string,NoCaseStringOrdering> NoCaseStrSet;
00107 
00111   void interfaceSet(
00112     const InterfaceDefSeq& baseInterfaces,
00113     set<string>&           repositoryIdSet,
00114     InterfaceDefSeq&       allBaseInterfaces
00115   );
00116 
00121   inline NoCaseStrSet inheritedNameSet(
00122     const InterfaceDefSeq& baseInterfaces
00123   );
00124 
00129   inline static bool nameSetOk(
00130     const ContainedSeq& contents,
00131     NoCaseStrSet&        result
00132   );
00133 };
00134 
00135 } // end namespace Omniifr
00136 
00137 #endif // OMNIIFR__INTERFACEDEF_H

Generated on Fri Mar 4 13:03:23 2005 for OmniIFR by  doxygen 1.4.1