summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm
diff options
context:
space:
mode:
authormhengstmengel <mhengstmengel@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2013-08-06 08:01:53 +0000
committermhengstmengel <mhengstmengel@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2013-08-06 08:01:53 +0000
commit853a8cc31872f51f140c9eecad48a7afb6ec7e33 (patch)
tree3ed055b435fafa057498f7dd44d7f1bf4f78aebd /CIAO/connectors/dds4ccm
parentc66d2826eb79762ad9a93bf1adbe9cc0c5433a0d (diff)
downloadATCD-853a8cc31872f51f140c9eecad48a7afb6ec7e33.tar.gz
Missig file sfor test
Diffstat (limited to 'CIAO/connectors/dds4ccm')
-rw-r--r--CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller.mpc138
-rw-r--r--CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller_exec.cpp278
-rw-r--r--CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller_exec.h165
3 files changed, 581 insertions, 0 deletions
diff --git a/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller.mpc b/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller.mpc
new file mode 100644
index 00000000000..6acca7d4c13
--- /dev/null
+++ b/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller.mpc
@@ -0,0 +1,138 @@
+// $Id$
+
+project(ShapesContr_Controller_idl_gen) : componentidldefaults{
+ custom_only = 1
+ after += Shapes_Contr_Base_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 \
+ -Wb,svnt_export_macro=CONTROLLER_SVNT_Export \
+ -Wb,svnt_export_include=Controller_svnt_export.h \
+ -Wb,exec_export_macro=CONTROLLER_EXEC_Export \
+ -Wb,exec_export_include=Controller_exec_export.h \
+ -I..
+
+ IDL_Files {
+ Shapes_Controller.idl
+ }
+}
+
+project(ShapesContr_Controller_lem_gen) : ciaoidldefaults {
+ after += ShapesContr_Controller_idl_gen Shapes_Contr_Base_lem_gen
+ custom_only = 1
+ idlflags += -Wb,export_macro=CONTROLLER_EXEC_Export \
+ -Wb,export_include=Controller_exec_export.h \
+ -SS
+
+ IDL_Files {
+ Shapes_ControllerE.idl
+ }
+}
+
+project(ShapesContr_Controller_stub) : ccm_stub {
+ after += ShapesContr_Controller_idl_gen Shapes_Contr_Base_stub
+ libs += Shapes_Contr_Base_stub
+ libout = ../lib
+ libpaths += ../lib
+
+ sharedname = ShapesContr_Controller_stub
+ dynamicflags += CONTROLLER_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Shapes_ControllerC.cpp
+ }
+
+ Header_Files {
+ Shapes_ControllerC.h
+ Shapes_Controller_stub_export.h
+ }
+
+ Inline_Files {
+ Shapes_ControllerC.inl
+ }
+}
+
+project(ShapesContr_Controller_exec) : ciao_executor {
+ after += ShapesContr_Controller_lem_gen ShapesContr_Controller_stub
+ sharedname = ShapesContr_Controller_exec
+ libs += ShapesContr_Controller_stub Shapes_Contr_Base_stub
+ libout = ../lib
+ libpaths += ../lib
+
+ dynamicflags += CONTROLLER_EXEC_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Shapes_ControllerEC.cpp
+ Shapes_Controller_exec.cpp
+ }
+
+ Header_Files {
+ Shapes_ControllerEC.h
+ Shapes_Controller_exec.h
+ Shapes_Controller_exec_export.h
+ }
+
+ Inline_Files {
+ Shapes_ControllerEC.inl
+ }
+}
+
+
+project(ShapesContr_Controller_svnt) : ciao_servant {
+ after += Shapes_Contr_Base_skel ShapesContr_Controller_exec Shapes_Contr_Base_svnt Shapes_Contr_Base_stub
+ sharedname = ShapesContr_Controller_svnt
+ libs += ShapesContr_Controller_exec \
+ ShapesContr_Controller_stub \
+ Shapes_Contr_Base_svnt \
+ Shapes_Contr_Base_stub
+ libout = ../lib
+ libpaths += ../lib
+
+ dynamicflags += CONTROLLER_SVNT_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Shapes_ControllerS.cpp
+ Shapes_Controller_svnt.cpp
+ }
+
+ Header_Files {
+ Shapes_ControllerS.h
+ Shapes_Controller_svnt.h
+ Shapes_Controller_svnt_export.h
+ }
+
+ Inline_Files {
+ }
+}
+
+//project (Thread_starter) : ccm_stub, valuetype {
+// exename = starter
+// after += ShapesContr_Controller_stub
+// libs += ShapesContr_Controller_stub Shapes_Contr_Base_stub
+// libout = ../lib
+// libpaths += ../lib
+
+// IDL_Files {
+// }
+
+// Source_Files {
+// starter.cpp
+// }
+
+// Header_Files {
+// }
+
+// Inline_Files {
+// }
+//}
+
diff --git a/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller_exec.cpp b/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller_exec.cpp
new file mode 100644
index 00000000000..0d11b1a3ecb
--- /dev/null
+++ b/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller_exec.cpp
@@ -0,0 +1,278 @@
+// -*- C++ -*-
+// $Id$
+
+/**
+ * @author Marijke Hengstmengel (mhengstmengel@remedy.nl)
+ */
+
+
+#include "Shapes_Controller_exec.h"
+#include "tao/ORB_Core.h"
+#include "ace/Reactor.h"
+
+namespace CIAO_Shapes_ShapesController_Impl
+{
+ CORBA::UShort
+ shape_attributes_get_i::max_size ()
+ {
+ return component_.max_size ();
+ }
+
+ CORBA::UShort
+ shape_attributes_get_i::max_x ()
+ {
+ return component_.max_x ();
+ }
+
+ CORBA::UShort
+ shape_attributes_get_i::max_y ()
+ {
+ return component_.max_y ();
+ }
+
+ CORBA::Boolean
+ shape_attributes_get_i::resize ()
+ {
+ return component_.resize_shape();
+ }
+ CORBA::ULong
+ shape_attributes_get_i::publish_rate ()
+ {
+ return (component_.publish_rate());
+ }
+
+ void
+ shape_attributes_set_i::max_size ( CORBA::UShort max_size)
+ {
+ component_.max_size (max_size);
+ }
+
+ void
+ shape_attributes_set_i::max_x ( CORBA::UShort max_x)
+ {
+ component_.max_x (max_x);
+ }
+
+ void
+ shape_attributes_set_i::max_y ( CORBA::UShort max_y)
+ {
+ component_.max_y (max_y);
+ }
+
+ void
+ shape_attributes_set_i::resize (CORBA::Boolean resize)
+ {
+ component_.resize_shape(resize);
+ }
+
+ void
+ shape_attributes_set_i::publish_rate (CORBA::ULong pub_rate)
+ {
+ component_.publish_rate(pub_rate);
+ }
+
+ void
+ shape_attributes_set_i::get_attr_values (CORBA::UShort_out max_size,
+ CORBA::UShort_out max_x,
+ CORBA::UShort_out max_y,
+ CORBA::ULong_out publish_rate,
+ CORBA::Boolean_out resize)
+ {
+ max_size = component_.max_size ();
+ max_x = component_.max_x ();
+ max_y = component_.max_y ();
+ publish_rate = component_.publish_rate ();
+ resize = component_.resize_shape();
+ }
+
+ void
+ shape_attributes_set_i::update_changes ()
+ {
+ component_.invoke_shape_changes ();
+ }
+
+ /**
+ * Component Executor Implementation Class: Controller_exec_i
+ */
+
+ Controller_exec_i::Controller_exec_i (void)
+ : publish_rate_ (0)
+ , max_size_ (50)
+ , max_x_ (200)
+ , max_y_ (200)
+ , resize_shape_ (false)
+ , use_web_interface_ (true)
+ {
+ }
+
+ Controller_exec_i::~Controller_exec_i (void)
+ {
+ }
+
+ // Supported operations and attributes.
+
+ // Component attributes and port operations.
+
+ ::CORBA::ULong
+ Controller_exec_i::publish_rate (void)
+ {
+ return this->publish_rate_;
+ }
+
+ void
+ Controller_exec_i::publish_rate (
+ const ::CORBA::ULong publish_rate)
+ {
+ this->publish_rate_ = publish_rate;
+ }
+
+ ::CORBA::UShort
+ Controller_exec_i::max_size (void)
+ {
+ return this->max_size_;
+ }
+
+ void
+ Controller_exec_i::max_size (
+ const ::CORBA::UShort max_size)
+ {
+ this->max_size_ = max_size;
+ }
+
+ ::CORBA::UShort
+ Controller_exec_i::max_x (void)
+ {
+ return this->max_x_;
+ }
+
+ void
+ Controller_exec_i::max_x (
+ const ::CORBA::UShort max_x)
+ {
+ this->max_x_ = max_x;
+ }
+
+ ::CORBA::UShort
+ Controller_exec_i::max_y (void)
+ {
+ return this->max_y_;
+ }
+
+ void
+ Controller_exec_i::max_y (
+ const ::CORBA::UShort max_y)
+ {
+ this->max_y_ = max_y;
+ }
+
+ ::CORBA::Boolean
+ Controller_exec_i::resize_shape (void)
+ {
+ return this->resize_shape_;
+ }
+
+ void
+ Controller_exec_i::resize_shape (
+ const ::CORBA::Boolean resize_shape)
+ {
+ this->resize_shape_ = resize_shape;
+ }
+
+ ::CORBA::Boolean
+ Controller_exec_i::use_web_interface (void)
+ {
+ return this->use_web_interface_;
+ }
+
+ void
+ Controller_exec_i::use_web_interface (
+ const ::CORBA::Boolean use_web_interface)
+ {
+ this->use_web_interface_ = use_web_interface;
+ }
+
+ void
+ Controller_exec_i::invoke_shape_changes (void)
+ {
+ shape_changes_var invoker =
+ this->ciao_context_->get_connection_shapeChangesSub ();
+
+ invoker->pass_change_event ();
+ }
+
+ CCM_shape_attributes_get*
+ Controller_exec_i::get_shapeAttribsPub ()
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Controller_exec_i::get_shapeAttribsPub\n")));
+ return ( new shape_attributes_get_i (*this) );
+
+ }
+
+ CCM_shape_attributes_set*
+ Controller_exec_i::get_shapeAttribsSet ()
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Controller_exec_i::get_shapeAttribsSet\n")));
+ return ( new shape_attributes_set_i (*this) );
+
+ }
+
+ // Operations from Components::SessionComponent.
+
+ void
+ Controller_exec_i::set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Controller_exec_i::set_session_context\n")));
+
+ this->ciao_context_ =
+ ::Shapes::CCM_ShapesController_Context::_narrow (ctx);
+
+ if ( ::CORBA::is_nil (this->ciao_context_.in ()))
+ {
+ throw ::CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ Controller_exec_i::configuration_complete (void)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Controller_exec_i::configuration_complete\n")));
+ }
+
+ void
+ Controller_exec_i::ccm_activate (void)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Controller_exec_i::ccm_activate\n")));
+ // If no extern web interface is used to start and stop publishing,
+ // start publishing now.
+ if (!use_web_interface_)
+ {
+ this->publish_rate_ = 1;
+ this->invoke_shape_changes();
+ }
+ }
+
+ void
+ Controller_exec_i::ccm_passivate (void)
+ {
+ }
+
+ void
+ Controller_exec_i::ccm_remove (void)
+ {
+ /* Your code here. */
+ }
+
+ extern "C" CONTROLLER_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Shapes_Controller_Impl (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_NORETURN (
+ retval,
+ Controller_exec_i);
+
+ return retval;
+ }
+}
diff --git a/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller_exec.h b/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller_exec.h
new file mode 100644
index 00000000000..d7979a151d1
--- /dev/null
+++ b/CIAO/connectors/dds4ccm/examples/ShapesContr/Controller/Shapes_Controller_exec.h
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef CIAO_SHAPES_CONTROLLER_EXEC_ETSDUL_H_
+#define CIAO_SHAPES_CONTROLLER_EXEC_ETSDUL_H_
+
+#include /**/ "ace/pre.h"
+
+#include "Shapes_ControllerEC.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_Shapes_ShapesController_Impl
+{
+
+ class Controller_exec_i;
+
+ class shape_attributes_get_i
+ : public virtual CCM_shape_attributes_get,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ shape_attributes_get_i (Controller_exec_i& component)
+ : component_ (component)
+ {
+ }
+
+ CORBA::UShort max_size (void);
+ CORBA::UShort max_x (void);
+ CORBA::UShort max_y (void);
+ CORBA::Boolean resize (void);
+ CORBA::ULong publish_rate (void);
+
+ private:
+ Controller_exec_i& component_;
+ };
+
+ class shape_attributes_set_i
+ : public virtual CCM_shape_attributes_set,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ shape_attributes_set_i (Controller_exec_i& component)
+ : component_ (component)
+ {
+ }
+
+ void max_size (CORBA::UShort);
+ void max_x (CORBA::UShort);
+ void max_y (CORBA::UShort);
+ void resize (CORBA::Boolean);
+ void publish_rate (CORBA::ULong);
+
+ void get_attr_values (CORBA::UShort_out max_size,
+ CORBA::UShort_out max_x,
+ CORBA::UShort_out max_y,
+ CORBA::ULong_out publish_rate,
+ CORBA::Boolean_out resize);
+
+ void update_changes ();
+
+ private:
+ Controller_exec_i& component_;
+ };
+
+ /**
+ * Component Executor Implementation Class: Controller_exec_i
+ */
+
+ class Controller_exec_i
+ : public virtual ShapesController_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ Controller_exec_i (void);
+ virtual ~Controller_exec_i (void);
+
+ //@{
+ /** Supported operations and attributes. */
+
+ //@}
+
+ //@{
+ /** Component attributes and port operations. */
+
+ virtual ::CORBA::ULong publish_rate (void);
+
+ virtual void publish_rate (::CORBA::ULong publish_rate);
+
+ virtual ::CORBA::UShort max_size (void);
+
+ virtual void max_size (::CORBA::UShort max_size);
+
+ virtual ::CORBA::UShort max_x (void);
+
+ virtual void max_x (::CORBA::UShort max_x);
+
+ virtual ::CORBA::UShort max_y (void);
+
+ virtual void max_y (::CORBA::UShort max_y);
+
+ virtual ::CORBA::Boolean resize_shape (void);
+
+ virtual void resize_shape (::CORBA::Boolean resize_shape);
+
+ virtual ::CORBA::Boolean use_web_interface (void);
+
+ virtual void use_web_interface (::CORBA::Boolean use_web_interface);
+
+ virtual CCM_shape_attributes_get* get_shapeAttribsPub (void);
+
+ virtual CCM_shape_attributes_set* get_shapeAttribsSet (void);
+ //@}
+
+ //@{
+ /** Operations from Components::SessionComponent. */
+ virtual void set_session_context (::Components::SessionContext_ptr ctx);
+ virtual void configuration_complete (void);
+ virtual void ccm_activate (void);
+ virtual void ccm_passivate (void);
+ virtual void ccm_remove (void);
+ //@}
+
+ //@{
+ /** User defined public operations. */
+ virtual void invoke_shape_changes (void);
+
+ //@}
+
+ private:
+ ::Shapes::CCM_ShapesController_Context_var ciao_context_;
+
+ //@{
+ /** Component attributes. */
+ ::CORBA::ULong publish_rate_;
+ ::CORBA::UShort max_size_;
+ ::CORBA::UShort max_x_;
+ ::CORBA::UShort max_y_;
+ ::CORBA::Boolean resize_shape_;
+ ::CORBA::Boolean use_web_interface_;
+ //@}
+
+ //@{
+ /** User defined members. */
+ //@}
+
+ //@{
+ /** User defined private operations. */
+ //@}
+ };
+}
+
+extern "C" CONTROLLER_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Shapes_Controller_Impl (void);
+
+
+#include /**/ "ace/post.h"
+
+#endif /* ifndef */