[OSADL-svn-commits] r69 - fapia-trunk/FAPIAConfiguration/interface

OSADL repository commits osadl-svn-commits at lists.osadl.org
Tue Oct 2 11:45:52 CEST 2007


Author: tb10rts
Date: Thu Jul 19 07:04:26 2007
New Revision: 69

Log:
Added a folder remotely

Added:
   fapia-trunk/FAPIAConfiguration/interface/
   fapia-trunk/FAPIAConfiguration/interface/FAPIAConfiguration.h
   fapia-trunk/FAPIAConfiguration/interface/FAPIAConfiguration.i
   fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationError.h
   fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationError.i
   fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationInit.h
   fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationInit.i
   fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationLogicalPhysicalObject.h
   fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationLogicalPhysicalObject.i
   fapia-trunk/FAPIAConfiguration/interface/FAPIAIConfiguration.h

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAConfiguration.h
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAConfiguration.h	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,156 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ *  @file    FAPIAConfiguration.h
+ *
+ *  $Id$
+ *
+ *  @author Martin Meintel <martin.meintel at homag.de>
+ */
+//=============================================================================
+
+#ifndef _FAPI_ACYCLIC_CONFIGURATION_H_
+#define _FAPI_ACYCLIC_CONFIGURATION_H_
+
+#ifdef WIN32
+  #define CONFIGFILE "C:/Machine1/SPS1/fieldbus_conf.xml"
+#else
+  #define  CONFIGFILE "/c/machine1/sps1/fieldbus_conf.xml"
+#endif
+#define XMLCONFIG_LOGICALDEVICES     "logicaldevices"
+#define XMLCONFIG_LOGICALDEVICE      "logicaldevice"
+#define XMLCONFIG_PHYSICALDEVICE     "physicaldevice"
+#define XMLCONFIG_NAME               "name"
+#define XMLCONFIG_COMMUNICATION      "communication"
+#define XMLCONFIG_DESCRIPTOR         "descriptor"
+
+
+#include "../interface/FAPIAIConfiguration.h"
+#include <xercesc/dom/DOM.hpp>
+#include /**/ <ace/SString.h>
+
+
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        namespace Configuration
+          {
+            /**
+             * @class Configuration
+             *
+             * @brief The Configuration class collects the information needed
+             * for the fapia to run from the xml configuration file.
+             *
+             */
+            class Configuration : public IConfiguration
+              {
+              public:
+                /**
+                 * @brief Constructor of Configuration.
+                 *
+                 */
+                Configuration (void);
+                
+                /**
+                 * @brief Copy Constructor.
+                 *
+                 */
+                Configuration (const Configuration&);
+
+                /**
+                 * @brief Assignment Operator.
+                 *
+                 */
+                const Configuration& operator= (const Configuration&);
+
+                /**
+                 * @brief Destructor of Configuration.
+                 *
+                 */
+                virtual ~Configuration (void);
+
+                /**
+                 * @brief Initializes the Configuration module.
+                 *
+                 * If it returns -1 there was an error. Have a look at the 
+                 * error object.
+                 *
+                 */
+                virtual int init
+                  (
+                    FAPI::Acyclic::Configuration::Init& init,
+                    FAPI::Acyclic::Configuration::Error& error
+                  );
+
+              private:
+                /**
+                 * @brief initializes the Configuration module with default
+                 * values.
+                 *
+                 */
+                void open (void);
+
+                /**
+                 * @brief closesthe Configuration module
+                 *
+                 */
+                void close(void);
+
+                /**
+                 * @brief copies the given values to this object
+                 *
+                 */
+                void copy (const Configuration&);
+
+                /**
+                 * @brief starts parsing the xml file.
+                 *
+                 */
+                int parseConfigurationFile
+                  (
+                    FAPI::Acyclic::Configuration::Init& init,
+                    FAPI::Acyclic::Configuration::Error& error
+                  );
+
+                /**
+                 * @brief tells whether the node has the specific attribute.
+                 *
+                 */
+                bool hasAttribute
+                  (
+                    const XERCES_CPP_NAMESPACE::DOMNode *dnp,
+                    const char* cpAttrName
+                  );
+
+                /**
+                 * @brief for returning the attributes value
+                 *
+                 */
+                const ACE_CString getAttributeValue 
+                  (
+                    const XERCES_CPP_NAMESPACE::DOMNode *dnp, 
+                    const char* cpAttrName
+                  );
+
+
+                bool isNodeNameLikeThis
+                  (
+                    const XERCES_CPP_NAMESPACE::DOMNode *dnp, 
+                    const char* cp
+                  );
+
+              }; /* class Configuration */
+          } /* namespace Configuration */
+      } /* namespace Acyclic */
+  } /* namespace FAPI */
+
+
+#if defined (__ACE_INLINE__)
+#include "FAPIAConfiguration.i"
+#endif /* __ACE_INLINE__ */
+
+
+#endif /*_FAPI_ACYCLIC_CONFIGURATION_H_ */

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAConfiguration.i
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAConfiguration.i	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,35 @@
+// $Id$
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        namespace Configuration
+          {
+            ACE_INLINE const Configuration& Configuration::operator= (const Configuration& conf)
+              {
+                if (this != &conf)
+                  {
+                    this->copy(conf);
+                  }
+                return *this;
+              }
+            
+            ACE_INLINE void Configuration::open (void)
+              {
+                //var = 123;
+              }
+            
+            ACE_INLINE void Configuration::close (void)
+              {
+                //var = 456;
+              }
+              
+            ACE_INLINE void Configuration::copy (const Configuration& /*conf*/)  
+              {
+                //this->var = conf.var;
+              }
+            
+      }/* namespace Configuration */
+    } /* namespace Acyclic */
+  } /* namespace FAPI */

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationError.h
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationError.h	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,106 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ *  @file    FAPIAConfigurationError.h
+ *
+ *  $Id$
+ *
+ *  @author Thomas Rothfuss <thomas.rothfuss at homag.de>
+ */
+//=============================================================================
+
+#ifndef _FAPI_ACYCLIC_CONFIGURATION_ERROR_H_
+#define _FAPI_ACYCLIC_CONFIGURATION_ERROR_H_
+
+#include /**/ <ace/SString.h>
+#include /**/ <ace/Vector_T.h>
+#include "../../interface/FAPIA.h"
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        namespace Configuration
+          {
+            /**
+             * @class Error
+             *
+             * @brief The Error struct contains error information.
+             *
+             */
+            class  Error
+              {
+
+              public:
+                /**
+                 * @brief Constructor of Error.
+                 *
+                 */
+                Error (void);
+
+                /**
+                 * @brief Copy Constructor.
+                 *
+                 */
+                Error (const Error&);
+
+                /**
+                 * @brief Assignment operator.
+                 *
+                 */
+                const Error& operator= (const Error&);
+
+                /**
+                 * @brief Destructor of Error.
+                 *
+                 */
+                virtual ~Error (void);
+
+              // The member variables are public. Therefore there is no need
+              // to implement get and set methods. This class is used as a
+              // structure with constructor, destructor, copy constructor and
+              // assignement operator.
+              public:
+                /// Error code. Maybe ok.
+                FAPIAErrorCode                       error_code_;
+
+                /// Reason of failure. If error_ is ok the reason_ is an
+                /// empty string.
+                ACE_CString                          reason_;
+
+              private:
+                /**
+                 * @brief for initializing the values.
+                 *
+                 */
+                void open (void);
+
+                /**
+                 * @brief for copying the values.
+                 *
+                 */
+                void copy (const Error&);
+
+                /**
+                 * @brief to deinitialize the values.
+                 *
+                 */
+                void close (void);
+
+
+
+              }; /* class Error */
+
+              /// This typedef is a container for Errors.
+              typedef  ACE_Vector<FAPI::Acyclic::Configuration::Error> Errors;
+
+          } /* namespace Configuration */
+      } /* namespace Acyclic */
+  } /* namespace FAPI */
+
+#if defined (__ACE_INLINE__)
+#include "FAPIAConfigurationError.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* _FAPI_ACYCLIC_CONFIGURATION_ERROR_H_ */

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationError.i
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationError.i	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,39 @@
+// $Id$
+
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        namespace Configuration
+          {
+            ACE_INLINE const Error& Error::operator= (const Error& err)
+              {
+                if (this != &err)
+                  {
+                    this->copy(err);
+                  }
+                return *this;
+              }
+            
+            ACE_INLINE void Error::open (void)
+              {
+                error_code_ = FAPIA_ERROR_OK;
+                reason_     = "";
+              }
+            
+            ACE_INLINE void Error::close (void)
+              {
+                error_code_ = FAPIA_ERROR_OK;
+                reason_     = "deinit";
+              }
+              
+            ACE_INLINE void Error::copy (const Error& err)  
+              {
+                this->error_code_ = err.error_code_;
+                this->reason_     = err.reason_;
+              }
+            
+      }/* namespace Configuration */
+    } /* namespace Acyclic */
+  } /* namespace FAPI */

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationInit.h
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationInit.h	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,104 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ *  @file    FAPIAConfigurationInit.h
+ *
+ *  $Id$
+ *
+ *  @author Thomas Rothfuss <thomas.rothfuss at homag.de>
+ */
+//=============================================================================
+
+#ifndef _FAPI_ACYCLIC_CONFIGURATION_INIT_H_
+#define _FAPI_ACYCLIC_CONFIGURATION_INIT_H_
+
+#include /**/ <ace/ace.h>
+#include "FAPIAConfigurationLogicalPhysicalObject.h"
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        namespace Configuration
+          {
+            /**
+             * @class Init
+             *
+             * @brief The Init structure is used to initialize the
+             * Configuration module.
+             *
+             */
+            class Init
+              {
+
+              public:
+                /**
+                 * @brief Constructor of Init.
+                 *
+                 */
+                Init (void);
+
+                /**
+                 * @brief Copy Constructor.
+                 *
+                 */
+                Init (const Init&);
+
+                /**
+                 * @brief Assignment operator.
+                 *
+                 */
+                const Init& operator= (const Init&);
+
+                /**
+                 * @brief Destructor of Init.
+                 *
+                 */
+                virtual ~Init (void);
+
+              // The member variables are public. Therefore there is no need
+              // to implement get and set methods. This class is used as a
+              // structure with constructor, destructor, copy constructor and
+              // assignement operator.
+              public:
+                /// Name of the file for the shared memory.
+                ACE_CString                                         fapia_shared_memory_name_;
+
+                /// Name of this physical object.
+                ACE_CString                                         physical_object_name_;
+
+                /// Logical objects and their corresponding physical objects.
+                FAPI::Acyclic::Configuration::LogicalPhysicalObjects logical_physical_objects_;
+
+
+              private:
+                /**
+                 * @brief for initializing the values.
+                 *
+                 */
+                void open (void);
+
+                /**
+                 * @brief for copying the values.
+                 *
+                 */
+                void copy (const Init&);
+
+                /**
+                 * @brief to deinitialize the values.
+                 *
+                 */
+                void close (void);
+
+              }; /* class Init */
+
+          } /* namespace Configuration */
+      } /* namespace Acyclic */
+  } /* namespace FAPI */
+
+#if defined (__ACE_INLINE__)
+#include "FAPIAConfigurationInit.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* _FAPI_ACYCLIC_CONFIGURATION_INIT_H_ */

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationInit.i
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationInit.i	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,39 @@
+// $Id$
+
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        namespace Configuration
+          {
+            ACE_INLINE const Init& Init::operator= (const Init& init)
+              {
+                if (this != &init)
+                  {
+                    this->copy(init);
+                  }
+                return *this;
+              }
+            
+            ACE_INLINE void Init::open (void)
+              {
+                physical_object_name_ = "";
+                logical_physical_objects_.clear();
+              }
+            
+            ACE_INLINE void Init::close (void)
+              {
+                physical_object_name_ = "deinit";
+                logical_physical_objects_.clear();
+              }
+              
+            ACE_INLINE void Init::copy (const Init& init)  
+              {
+                this->physical_object_name_       = init.physical_object_name_;
+                this->logical_physical_objects_   = init.logical_physical_objects_;
+              }
+            
+      }/* namespace Configuration */
+    } /* namespace Acyclic */
+  } /* namespace FAPI */

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationLogicalPhysicalObject.h
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationLogicalPhysicalObject.h	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,106 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ *  @file    FAPIAConfigurationLogicalPhysicalObject.h
+ *
+ *  $Id$
+ *
+ *  @author Thomas Rothfuss <thomas.rothfuss at homag.de>
+ */
+//=============================================================================
+
+#ifndef _FAPI_ACYCLIC_CONFIGURATION_LOGICAL_PHYSICAL_OBJECT_H_
+#define _FAPI_ACYCLIC_CONFIGURATION_LOGICAL_PHYSICAL_OBJECT_H_
+
+#include /**/ <ace/ace.h>
+#include /**/ <ace/Vector_T.h>
+#include /**/ <ace/SString.h>
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        namespace Configuration
+          {
+            /**
+             * @class LogicalPhysicalObject
+             *
+             * @brief The LogicalPhysicalObject holds the relation between
+             * logical and physical objects.
+             *
+             */
+            class LogicalPhysicalObject
+              {
+
+              public:
+                /**
+                 * @brief Constructor of LogicalPhysicalObject.
+                 *
+                 */
+                LogicalPhysicalObject (void);
+
+                /**
+                 * @brief Copy Constructor.
+                 *
+                 */
+                LogicalPhysicalObject (const LogicalPhysicalObject&);
+
+                /**
+                 * @brief Assignment operator.
+                 *
+                 */
+                const LogicalPhysicalObject& operator= (const LogicalPhysicalObject&);
+
+                /**
+                 * @brief Destructor of LogicalPhysicalObject.
+                 *
+                 */
+                virtual ~LogicalPhysicalObject (void);
+
+              // The member variables are public. Therefore there is no need
+              // to implement get and set methods. This class is used as a
+              // structure with constructor, destructor, copy constructor and
+              // assignement operator.
+              public:
+                /// Name of the logical object.
+                ACE_CString                          logical_object_name_;
+
+                /// Name of the corresponding physical object.
+                ACE_CString                          physical_object_name_;
+
+              private:
+                /**
+                 * @brief for initializing the values.
+                 *
+                 */
+                void open (void);
+
+                /**
+                 * @brief for copying the values.
+                 *
+                 */
+                void copy (const LogicalPhysicalObject&);
+
+                /**
+                 * @brief to deinitialize the values.
+                 *
+                 */
+                void close (void);
+
+              }; /* class LogicalPhysicalObject */
+
+              /// This typedef is a container for LogicalPhysicalObjects.
+              typedef  ACE_Vector<FAPI::Acyclic::Configuration::LogicalPhysicalObject> LogicalPhysicalObjects;
+
+          } /* namespace Configuration */
+      } /* namespace Acyclic */
+  } /* namespace FAPI */
+
+
+
+#if defined (__ACE_INLINE__)
+#include "FAPIAConfigurationLogicalPhysicalObject.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* _FAPI_ACYCLIC_CONFIGURATION_LOGICAL_PHYSICAL_OBJECT_H_ */

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationLogicalPhysicalObject.i
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAConfigurationLogicalPhysicalObject.i	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,40 @@
+// $Id$
+
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        namespace Configuration
+          {
+            ACE_INLINE const LogicalPhysicalObject& LogicalPhysicalObject::operator= 
+              (const LogicalPhysicalObject& lpo)
+              {
+                if (this != &lpo)
+                  {
+                    this->copy(lpo);
+                  }
+                return *this;
+              }
+            
+            ACE_INLINE void LogicalPhysicalObject::open (void)
+              {
+                logical_object_name_   = "";
+                physical_object_name_  = "";
+              }
+            
+            ACE_INLINE void LogicalPhysicalObject::close (void)
+              {
+                logical_object_name_  = "deinit";
+                physical_object_name_ = "deinit";
+              }
+              
+            ACE_INLINE void LogicalPhysicalObject::copy (const LogicalPhysicalObject& lpo)  
+              {
+                this->logical_object_name_  = lpo.logical_object_name_;
+                this->physical_object_name_ = lpo.physical_object_name_;
+              }
+            
+      }/* namespace Configuration */
+    } /* namespace Acyclic */
+  } /* namespace FAPI */

Added: fapia-trunk/FAPIAConfiguration/interface/FAPIAIConfiguration.h
==============================================================================
--- (empty file)
+++ fapia-trunk/FAPIAConfiguration/interface/FAPIAIConfiguration.h	Thu Jul 19 07:04:26 2007
@@ -0,0 +1,51 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ *  @file    FAPIAIConfiguration.h
+ *
+ *  $Id$
+ *
+ *  @author Thomas Rothfuss <thomas.rothfuss at homag.de>
+ */
+//=============================================================================
+
+#ifndef _FAPI_ACYCLIC_ICONFIGURATION_H_
+#define _FAPI_ACYCLIC_ICONFIGURATION_H_
+
+#include "FAPIAConfigurationInit.h"
+#include "FAPIAConfigurationError.h"
+
+namespace FAPI
+  {
+    namespace Acyclic
+      {
+        /**
+         * @interface IConfiguration
+         *
+         * @brief The IConfiguration is the interface for the configuration
+         * module.
+         *
+         */
+        class IConfiguration
+          {
+
+          public:
+            /**
+             * @brief Initializes the Configuration module.
+             *
+             * If it returns -1 there was an error. Look at the error object.
+             *
+             */
+            virtual int init
+              (
+                FAPI::Acyclic::Configuration::Init& init,
+                FAPI::Acyclic::Configuration::Error& error
+              ) = 0;
+
+          }; /* class IConfiguration */
+
+      } /* namespace Acyclic */
+  } /* namespace FAPI */
+
+#endif /* _FAPI_ACYCLIC_ICONFIGURATION_H_ */


More information about the OSADL-svn-commits mailing list