Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

devicemanager_p.h

Go to the documentation of this file.
00001 /*-*-c++-*-*****************************************************************
00002  devicemanager.h
00003  ---------------
00004  begin       : 15.03.2006
00005  copyright   : (C) 2006 by Christian Stimming
00006  email       : stimming@tuhh.de
00007 
00008  ***************************************************************************
00009  *                                                                         *
00010  *   This library is free software; you can redistribute it and/or         *
00011  *   modify it under the terms of the GNU Lesser General Public            *
00012  *   License as published by the Free Software Foundation; either          *
00013  *   version 2.1 of the License, or (at your option) any later version.    *
00014  *                                                                         *
00015  *   This library is distributed in the hope that it will be useful,       *
00016  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00018  *   Lesser General Public License for more details.                       *
00019  *                                                                         *
00020  *   You should have received a copy of the GNU Lesser General Public      *
00021  *   License along with this library; if not, write to the Free Software   *
00022  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00023  *   MA  02111-1307  USA                                                   *
00024  *                                                                         *
00025  ***************************************************************************/
00026 
00027 #ifndef SIMTHETIC_DEVICEMANAGER_P_H
00028 #define SIMTHETIC_DEVICEMANAGER_P_H
00029 
00037 #include "devicemanager.h"
00038 
00039 #include <gwenhywfar/xml.h>
00040 
00041 namespace simth {
00042 
00048   class DeviceDescriptionPriv {
00049         friend class DeviceDescription;
00050     friend class DeviceManager;
00051     friend class DeviceManagerPriv;
00052      private:
00053     std::string _name;
00054     std::string _type;
00055     std::string _type_escaped;
00056     std::string _extends;
00057     PropertyList _properties;
00058     Property::list_string _libraries;
00059     bool _abstract;
00060     std::string _description;
00061     DeviceDescription::IfaceList _input_interfaces;
00062     DeviceDescription::IfaceList _output_interfaces;
00063 
00064     // Read in a propertylist for a given device. If necessary,
00065     // recursively use this function for its parent devices.
00066     static void 
00067     _readDeviceProperties(PropertyList &pl, 
00068                   GWEN_XMLNODE *dn,
00069                   const std::string &dname,
00070                   int depth,
00071                   Property::list_string &sl,
00072                   DeviceDescription::IfaceList& input_interfaces,
00073                   DeviceDescription::IfaceList& output_interfaces);
00074 
00075     // Read a propertylist from a node for the given device. No more
00076     // recursion inside here.
00077     static void _readPropertylistNode(PropertyList &pl,
00078                       GWEN_XMLNODE *pnode,
00079                       const std::string &dname);
00080 
00081     // Read the overriddenproperties element here and remove the
00082     // respective elements from the given propertylist
00083     static void _readOverriddenPropNode(PropertyList &pl,
00084                         GWEN_XMLNODE *pnode,
00085                         const std::string &dname);
00086 
00087     // Read a interfacelist from a node for the given device. No
00088     // more recursion inside here.
00089     static void _readInterfacelistNode(DeviceDescription::IfaceList& iiflist,
00090                        GWEN_XMLNODE *pnode,
00091                        const std::string &dname);
00092 
00093     // Construct a DeviceDescription from the specified devicenode.
00094     DeviceDescriptionPriv (GWEN_XMLNODE *devicenode,
00095                    GWEN_XMLNODE *devicelist, 
00096                    const std::string& dname);
00097 
00098      public:
00099     DeviceDescriptionPriv();
00100     ~DeviceDescriptionPriv();
00101   };
00102 
00108   class DeviceManagerPriv {
00109      public:
00110     // Read in the given file name into the given rootnode and return
00111     // a pointer to the devicelist node.
00112     static GWEN_XMLNODE *
00113     _getDevicelistFromFile(DeviceManager &dm,
00114                    const std::string &fname,
00115                    GWEN_XMLNODE *rootnode)
00116        throw(file_not_found, bad_device_file);
00117     
00121     static GWEN_XMLNODE *findDeviceNode(GWEN_XMLNODE *dn,
00122                         const std::string &dname);
00123     
00125     static std::string getStringData(GWEN_XMLNODE *node);
00126 
00129     static GWEN_XMLNODE *findNodeByName(GWEN_XMLNODE *node,
00130                         const std::string& node_name,
00131                         const std::string& filename,
00132                         bool required = true)
00133        throw(simth::bad_device_file);
00134   };
00135 
00136 
00137 } /* namespace */
00138 
00139 
00140 #endif /* SIMTHETIC_DEVICEMANAGER_H */
00141 
00142 
00143 

Generated on Mon Apr 24 21:19:19 2006 for simthetic by  doxygen 1.4.1