00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
00065
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
00076
00077 static void _readPropertylistNode(PropertyList &pl,
00078 GWEN_XMLNODE *pnode,
00079 const std::string &dname);
00080
00081
00082
00083 static void _readOverriddenPropNode(PropertyList &pl,
00084 GWEN_XMLNODE *pnode,
00085 const std::string &dname);
00086
00087
00088
00089 static void _readInterfacelistNode(DeviceDescription::IfaceList& iiflist,
00090 GWEN_XMLNODE *pnode,
00091 const std::string &dname);
00092
00093
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
00111
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 }
00138
00139
00140 #endif
00141
00142
00143