diff options
Diffstat (limited to 'modules/CIAO/RACE/Controller/Component')
8 files changed, 598 insertions, 0 deletions
diff --git a/modules/CIAO/RACE/Controller/Component/Controller.cidl b/modules/CIAO/RACE/Controller/Component/Controller.cidl new file mode 100644 index 00000000000..0122563c69a --- /dev/null +++ b/modules/CIAO/RACE/Controller/Component/Controller.cidl @@ -0,0 +1,28 @@ +// $Id$ +#ifndef RACE_CONTROLLER_CIDL +#define RACE_CONTROLLER_CIDL + +/* + * @file Controller.cidl + * @brief This file contains the Controller component implementation defination. + */ + +#include "Controller.idl" + +module CIAO +{ + module RACE + { + composition session Controller_Impl + { + home executor Controller_Home_Exec + { + implements Controller_Home; + manages Controller_Exec; + }; + }; + }; +}; + + +#endif /* RACE_CONTROLLER_CIDL */ diff --git a/modules/CIAO/RACE/Controller/Component/Controller.idl b/modules/CIAO/RACE/Controller/Component/Controller.idl new file mode 100644 index 00000000000..3d2959995df --- /dev/null +++ b/modules/CIAO/RACE/Controller/Component/Controller.idl @@ -0,0 +1,64 @@ +// $Id$ + +#ifndef RACE_CONTROLLER_IDL +#define RACE_CONTROLLER_IDL + +/** + * @file Controller.idl + * + * @brief Controller Component of RACE. + * + * This file declares a Controller of the RACE framework. + * + * @author Nishanth Shankaran <nshankar@dre.vanderbilt.edu> + */ + +#include <Components.idl> +#include "ciao/Deployment_Target_Data.idl" +#include "DAnCE/TargetManager/TargetManagerExt.idl" + +/** + * @module CIAO + * @brief The CIAO module. + */ +module CIAO +{ + module RACE + { + + /** + * @interface Trigger + * @brief This interface is used to start and stop + * the feedback loop of the controller. + */ + interface Trigger + { + oneway void start (); + + oneway void stop (); + }; + + /** + * @component Controller + * @brief The Controller component of RACE. + */ + + component Controller supports Trigger + { + uses TargetManagerExt target_mgr_ext; + uses ::Deployment::TargetManager targer_mgr; + + /// @todo Need to integrate the receptacle for the BDC facet into + /// the controller. + // uses BDC_QoS bdc; + + /// The sampling period of the controller. + readonly attribute double sampling_period; + }; + + home Controller_Home manages Controller + { + }; + }; +}; +#endif /* RACE_CONTROLLER_IDL */ diff --git a/modules/CIAO/RACE/Controller/Component/Controller.mpc b/modules/CIAO/RACE/Controller/Component/Controller.mpc new file mode 100644 index 00000000000..aa1a77e0495 --- /dev/null +++ b/modules/CIAO/RACE/Controller/Component/Controller.mpc @@ -0,0 +1,64 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl Controller" + +project(Controller_stub): ciao_deployment_stub { + + after += CIAO_TargetManager_stub + sharedname = Controller_stub + libs += TargetManager_stub NodeManager_stub + idlflags += -Wb,stub_export_macro=CONTROLLER_STUB_Export \ + -Wb,stub_export_include=Controller_stub_export.h \ + -Wb,skel_export_macro=CONTROLLER_SVNT_Export \ + -Wb,skel_export_include=Controller_svnt_export.h + dynamicflags = CONTROLLER_STUB_BUILD_DLL + + IDL_Files { + Controller.idl + } + + Source_Files { + ControllerC.cpp + } +} + +project(Controller_svnt) : ciao_servant_dnc { + after += Controller_stub CIAO_TargetManager_svnt + sharedname = Controller_svnt + libs += Controller_stub TargetManager_stub TargetManager_svnt NodeManager_stub + + idlflags += -Wb,export_macro=CONTROLLER_SVNT_Export \ + -Wb,export_include=Controller_svnt_export.h + dynamicflags = CONTROLLER_SVNT_BUILD_DLL + + CIDL_Files { + Controller.cidl + } + + IDL_Files { + ControllerE.idl + } + + Source_Files { + ControllerEC.cpp + ControllerS.cpp + Controller_svnt.cpp + } +} + + +project(Controller_exec) : ciao_component_dnc { + after += Controller_svnt + sharedname = Controller_exec + libs += Controller_stub Controller_svnt TargetManager_stub TargetManager_svnt NodeManager_stub + + idlflags += -Wb,export_macro=CONTROLLER_EXEC_Export \ + -Wb,export_include=Controller_exec_export.h + dynamicflags = CONTROLLER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Controller_exec.cpp + } +} diff --git a/modules/CIAO/RACE/Controller/Component/Controller_exec.cpp b/modules/CIAO/RACE/Controller/Component/Controller_exec.cpp new file mode 100644 index 00000000000..1606e03a867 --- /dev/null +++ b/modules/CIAO/RACE/Controller/Component/Controller_exec.cpp @@ -0,0 +1,160 @@ +// $Id$ +#include "Controller_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIAO +{ + namespace RACE + { + namespace CIDL_Controller_Impl + { + Controller_exec_i::Controller_exec_i (void) + { + } + + Controller_exec_i::~Controller_exec_i (void) + { + } + + // Supported operations. + void + Controller_exec_i::start () + ACE_THROW_SPEC ((::CORBA::SystemException)) + {} + + void + Controller_exec_i::stop () + ACE_THROW_SPEC ((::CORBA::SystemException)) + {} + + // Attribute operations. + + ::CORBA::Double + Controller_exec_i::sampling_period () + ACE_THROW_SPEC ((CORBA::SystemException)) + { + // Your code here. + return 0.0; + } + + // Port operations. + + // Operations from Components::SessionComponent + + void + Controller_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + this->context_ = + Controller_Context::_narrow ( + ctx); + + if (this->context_ == 0) + { + throw CORBA::INTERNAL (); + } + } + + void + Controller_exec_i::ciao_preactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + Controller_exec_i::ciao_postactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + Controller_exec_i::ccm_activate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + Controller_exec_i::ccm_passivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + Controller_exec_i::ccm_remove () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: Controller_Home_exec_i + //================================================================== + + Controller_Home_exec_i::Controller_Home_exec_i (void) + { + } + + Controller_Home_exec_i::~Controller_Home_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + Controller_Home_exec_i::create () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + Controller_exec_i, + CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" CONTROLLER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_CIAO_RACE_Controller_Home_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + Controller_Home_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } + } + } +} diff --git a/modules/CIAO/RACE/Controller/Component/Controller_exec.h b/modules/CIAO/RACE/Controller/Component/Controller_exec.h new file mode 100644 index 00000000000..def356fef65 --- /dev/null +++ b/modules/CIAO/RACE/Controller/Component/Controller_exec.h @@ -0,0 +1,120 @@ +// $Id$ +#ifndef CIAO_CONTROLLER_EXEC_H +#define CIAO_CONTROLLER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "Controller_svnt.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Controller_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIAO +{ + namespace RACE + { + namespace CIDL_Controller_Impl + { + class CONTROLLER_EXEC_Export Controller_exec_i + : public virtual Controller_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + Controller_exec_i (void); + virtual ~Controller_exec_i (void); + + // Supported operations. + virtual void start () + ACE_THROW_SPEC ((::CORBA::SystemException)); + + virtual void stop () + ACE_THROW_SPEC ((::CORBA::SystemException)); + + // Attribute operations. + virtual ::CORBA::Double + sampling_period () + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ciao_preactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ciao_postactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_activate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_passivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_remove () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + protected: + Controller_Context *context_; + }; + + class CONTROLLER_EXEC_Export Controller_Home_exec_i + : public virtual Controller_Home_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + Controller_Home_exec_i (void); + virtual ~Controller_Home_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + }; + + extern "C" CONTROLLER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_CIAO_RACE_Controller_Home_Impl (void); + } + } +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_CONTROLLER_EXEC_H */ diff --git a/modules/CIAO/RACE/Controller/Component/Controller_exec_export.h b/modules/CIAO/RACE/Controller/Component/Controller_exec_export.h new file mode 100644 index 00000000000..080ecb25a44 --- /dev/null +++ b/modules/CIAO/RACE/Controller/Component/Controller_exec_export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CONTROLLER_EXEC +// ------------------------------ +#ifndef CONTROLLER_EXEC_EXPORT_H +#define CONTROLLER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (CONTROLLER_EXEC_HAS_DLL) +# define CONTROLLER_EXEC_HAS_DLL 1 +#endif /* ! CONTROLLER_EXEC_HAS_DLL */ + +#if defined (CONTROLLER_EXEC_HAS_DLL) && (CONTROLLER_EXEC_HAS_DLL == 1) +# if defined (CONTROLLER_EXEC_BUILD_DLL) +# define CONTROLLER_EXEC_Export ACE_Proper_Export_Flag +# define CONTROLLER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CONTROLLER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CONTROLLER_EXEC_BUILD_DLL */ +# define CONTROLLER_EXEC_Export ACE_Proper_Import_Flag +# define CONTROLLER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CONTROLLER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CONTROLLER_EXEC_BUILD_DLL */ +#else /* CONTROLLER_EXEC_HAS_DLL == 1 */ +# define CONTROLLER_EXEC_Export +# define CONTROLLER_EXEC_SINGLETON_DECLARATION(T) +# define CONTROLLER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CONTROLLER_EXEC_HAS_DLL == 1 */ + +// Set CONTROLLER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CONTROLLER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define CONTROLLER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CONTROLLER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CONTROLLER_EXEC_NTRACE */ + +#if (CONTROLLER_EXEC_NTRACE == 1) +# define CONTROLLER_EXEC_TRACE(X) +#else /* (CONTROLLER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CONTROLLER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CONTROLLER_EXEC_NTRACE == 1) */ + +#endif /* CONTROLLER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Controller/Component/Controller_stub_export.h b/modules/CIAO/RACE/Controller/Component/Controller_stub_export.h new file mode 100644 index 00000000000..65a430401a8 --- /dev/null +++ b/modules/CIAO/RACE/Controller/Component/Controller_stub_export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CONTROLLER_STUB +// ------------------------------ +#ifndef CONTROLLER_STUB_EXPORT_H +#define CONTROLLER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (CONTROLLER_STUB_HAS_DLL) +# define CONTROLLER_STUB_HAS_DLL 1 +#endif /* ! CONTROLLER_STUB_HAS_DLL */ + +#if defined (CONTROLLER_STUB_HAS_DLL) && (CONTROLLER_STUB_HAS_DLL == 1) +# if defined (CONTROLLER_STUB_BUILD_DLL) +# define CONTROLLER_STUB_Export ACE_Proper_Export_Flag +# define CONTROLLER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CONTROLLER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CONTROLLER_STUB_BUILD_DLL */ +# define CONTROLLER_STUB_Export ACE_Proper_Import_Flag +# define CONTROLLER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CONTROLLER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CONTROLLER_STUB_BUILD_DLL */ +#else /* CONTROLLER_STUB_HAS_DLL == 1 */ +# define CONTROLLER_STUB_Export +# define CONTROLLER_STUB_SINGLETON_DECLARATION(T) +# define CONTROLLER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CONTROLLER_STUB_HAS_DLL == 1 */ + +// Set CONTROLLER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CONTROLLER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define CONTROLLER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CONTROLLER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CONTROLLER_STUB_NTRACE */ + +#if (CONTROLLER_STUB_NTRACE == 1) +# define CONTROLLER_STUB_TRACE(X) +#else /* (CONTROLLER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CONTROLLER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CONTROLLER_STUB_NTRACE == 1) */ + +#endif /* CONTROLLER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Controller/Component/Controller_svnt_export.h b/modules/CIAO/RACE/Controller/Component/Controller_svnt_export.h new file mode 100644 index 00000000000..d5e7c6aa42d --- /dev/null +++ b/modules/CIAO/RACE/Controller/Component/Controller_svnt_export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CONTROLLER_SVNT +// ------------------------------ +#ifndef CONTROLLER_SVNT_EXPORT_H +#define CONTROLLER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (CONTROLLER_SVNT_HAS_DLL) +# define CONTROLLER_SVNT_HAS_DLL 1 +#endif /* ! CONTROLLER_SVNT_HAS_DLL */ + +#if defined (CONTROLLER_SVNT_HAS_DLL) && (CONTROLLER_SVNT_HAS_DLL == 1) +# if defined (CONTROLLER_SVNT_BUILD_DLL) +# define CONTROLLER_SVNT_Export ACE_Proper_Export_Flag +# define CONTROLLER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CONTROLLER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CONTROLLER_SVNT_BUILD_DLL */ +# define CONTROLLER_SVNT_Export ACE_Proper_Import_Flag +# define CONTROLLER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CONTROLLER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CONTROLLER_SVNT_BUILD_DLL */ +#else /* CONTROLLER_SVNT_HAS_DLL == 1 */ +# define CONTROLLER_SVNT_Export +# define CONTROLLER_SVNT_SINGLETON_DECLARATION(T) +# define CONTROLLER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CONTROLLER_SVNT_HAS_DLL == 1 */ + +// Set CONTROLLER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CONTROLLER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define CONTROLLER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CONTROLLER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CONTROLLER_SVNT_NTRACE */ + +#if (CONTROLLER_SVNT_NTRACE == 1) +# define CONTROLLER_SVNT_TRACE(X) +#else /* (CONTROLLER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CONTROLLER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CONTROLLER_SVNT_NTRACE == 1) */ + +#endif /* CONTROLLER_SVNT_EXPORT_H */ + +// End of auto generated file. |