summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm
diff options
context:
space:
mode:
authormsmit <msmit@remedy.nl>2010-11-22 14:39:22 +0000
committermsmit <msmit@remedy.nl>2010-11-22 14:39:22 +0000
commit3328dd4d2d0068f2ca95c92030858cece9f0242f (patch)
tree71ad375d440552b136ff2c60e3869c0b0aa7bdeb /CIAO/connectors/dds4ccm
parent7450c9f81618a8df8df4d40b129040fc390fc0fc (diff)
downloadATCD-3328dd4d2d0068f2ca95c92030858cece9f0242f.tar.gz
Mon Nov 22 14:38:52 UTC 2010 Marcel Smit <msmit@remedy.nl>
* connectors/dds4ccm/examples/Large_Deployment/Common/Common.idl: * connectors/dds4ccm/examples/Large_Deployment/Common/Common.mpc: * connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.idl: * connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.mpc: * connectors/dds4ccm/examples/Large_Deployment/DDS_Pub/DDS_Pub.idl: * connectors/dds4ccm/examples/Large_Deployment/DDS_Sub/DDS_Sub.idl: * connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.idl: * connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.mpc: * connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.h: * connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.cpp: Split common.idl into two pieces: One which contains the type declaration, the other one contains the interface definition.
Diffstat (limited to 'CIAO/connectors/dds4ccm')
-rw-r--r--CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.idl6
-rw-r--r--CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.mpc4
-rw-r--r--CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.idl11
-rw-r--r--CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.mpc67
-rw-r--r--CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Pub/DDS_Pub.idl2
-rw-r--r--CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Sub/DDS_Sub.idl2
-rw-r--r--CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.idl2
-rw-r--r--CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.mpc20
-rw-r--r--CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.cpp141
-rw-r--r--CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.h16
10 files changed, 149 insertions, 122 deletions
diff --git a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.idl b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.idl
index a0079689b0e..c0d19a6e3a4 100644
--- a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.idl
+++ b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.idl
@@ -8,12 +8,6 @@
struct LargeType {
string value; //@key
};
-
typedef sequence<LargeType> LargeTypeSeq;
-interface Simple_Service
-{
- oneway void ping ();
-};
-
#endif
diff --git a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.mpc b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.mpc
index fc193c65cd7..9f7b289b0d9 100644
--- a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.mpc
+++ b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Common.mpc
@@ -8,8 +8,8 @@ project (Large_Deployment_stub) : ciaoidldefaults, \
idlflags += -Gxhst \
-Wb,export_macro=LARGE_DEPLOYMENT_COMMON_STUB_Export \
- -Wb,export_include=Large_Deployment_Common_stub_export.h
-
+ -Wb,export_include=Large_Deployment_Common_stub_export.h
+
IDL_Files {
Common.idl
diff --git a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.idl b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.idl
new file mode 100644
index 00000000000..a1d53ba40d0
--- /dev/null
+++ b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.idl
@@ -0,0 +1,11 @@
+// $Id$
+
+#ifndef SINGLE_SERVICE_COMMON_IDL_
+#define SINGLE_SERVICE_COMMON_IDL_
+
+interface Simple_Service
+{
+ oneway void ping ();
+};
+
+#endif /* SINGLE_SERVICE_COMMON_IDL_ */
diff --git a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.mpc b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.mpc
new file mode 100644
index 00000000000..630c2d1e844
--- /dev/null
+++ b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Common/Single_Service_Common.mpc
@@ -0,0 +1,67 @@
+// $Id$
+
+project(Single_Service_Common_idl_gen) : taoidldefaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=SINGLE_SERVICE_COMMON_STUB_Export \
+ -Wb,stub_export_include=Single_Service_Common_stub_export.h \
+ -Wb,stub_export_macro=SINGLE_SERVICE_COMMON_SVNT_Export \
+ -Wb,stub_export_include=Single_Service_Common_svnt_export.h \
+ -Gxhst
+
+ IDL_Files {
+ Single_Service_Common.idl
+ }
+}
+
+
+project(Single_Service_Common_stub) : ccm_stub {
+ after += Single_Service_Common_idl_gen
+
+ libpaths += ../lib
+ libout = ../lib
+
+ sharedname = Single_Service_Common_stub
+ dynamicflags += SINGLE_SERVICE_COMMON_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Single_Service_CommonC.cpp
+ }
+
+ Header_Files {
+ Single_Service_CommonC.h
+ Single_Service_Common_stub_export.h
+ }
+
+ Inline_Files {
+ Single_Service_CommonC.inl
+ }
+}
+
+project(Single_Service_Common_svnt) : ccm_svnt {
+ after += Single_Service_Common_idl_gen
+
+ libpaths += ../lib
+ libout = ../lib
+
+ sharedname = Single_Service_Common_svnt
+ dynamicflags += SINGLE_SERVICE_COMMON_SVNT_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Single_Service_CommonS.cpp
+ }
+
+ Header_Files {
+ Single_Service_CommonS.h
+ Single_Service_Common_svnt_export.h
+ }
+
+ Inline_Files {
+ Single_Service_CommonS.inl
+ }
+}
diff --git a/CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Pub/DDS_Pub.idl b/CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Pub/DDS_Pub.idl
index ce73eacb942..e118793b6d4 100644
--- a/CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Pub/DDS_Pub.idl
+++ b/CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Pub/DDS_Pub.idl
@@ -3,7 +3,7 @@
#ifndef DDS_PUB_IDL
#define DDS_PUB_IDL
-#include "Common/Common.idl"
+#include "Common/Single_Service_Common.idl"
#include "Connector/Large_Connector.idl"
component DDS_Pub
diff --git a/CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Sub/DDS_Sub.idl b/CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Sub/DDS_Sub.idl
index 87d788bd0c1..2b4a6bf5194 100644
--- a/CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Sub/DDS_Sub.idl
+++ b/CIAO/connectors/dds4ccm/examples/Large_Deployment/DDS_Sub/DDS_Sub.idl
@@ -3,7 +3,7 @@
#ifndef DDS_SUB_IDL
#define DDS_SUB_IDL
-#include "Common/Common.idl"
+#include "Common/Single_Service_Common.idl"
#include "Connector/Large_Connector.idl"
component DDS_Sub
diff --git a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.idl b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.idl
index d0952f70803..1651897e3cf 100644
--- a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.idl
+++ b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.idl
@@ -4,7 +4,7 @@
#define SINGLE_SERVICE_IDL
#include <Components.idl>
-#include "Common/Common.idl"
+#include "Common/Single_Service_Common.idl"
component Single_Service
{
diff --git a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.mpc b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.mpc
index 3713d6bde2e..4cc23964f6b 100644
--- a/CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.mpc
+++ b/CIAO/connectors/dds4ccm/examples/Large_Deployment/Single_Service/Single_Service.mpc
@@ -17,7 +17,7 @@ project(Single_Service_idl_gen) : componentidldefaults {
}
project(Single_Service_lem_gen) : ciaoidldefaults {
- after += Single_Service_idl_gen
+ after += Single_Service_idl_gen
custom_only = 1
idlflags += -Wb,stub_export_macro=SINGLE_SERVICE_LEM_STUB_Export \
-Wb,stub_export_include=Single_Service_lem_stub_export.h \
@@ -29,8 +29,8 @@ project(Single_Service_lem_gen) : ciaoidldefaults {
}
project(Single_Service_lem_stub) : ccm_svnt {
- after += Single_Service_lem_gen Single_Service_stub Large_Deployment_stub
- libs += Single_Service_stub Large_Deployment_stub
+ after += Single_Service_lem_gen Single_Service_stub Single_Service_Common_stub
+ libs += Single_Service_stub Single_Service_Common_stub
libpaths += ../lib
libout = ../lib
includes += ..
@@ -55,8 +55,8 @@ project(Single_Service_lem_stub) : ccm_svnt {
}
project(Single_Service_stub) : ccm_stub {
- after += Single_Service_idl_gen Large_Deployment_stub
- libs += Large_Deployment_stub
+ after += Single_Service_idl_gen Single_Service_Common_stub
+ libs += Single_Service_Common_stub
libpaths += ../lib
libout = ../lib
includes += ..
@@ -83,7 +83,7 @@ project(Single_Service_stub) : ccm_stub {
project(Single_Service_exec) : ciao_executor {
after += Single_Service_lem_stub Single_Service_stub
sharedname = Single_Service_exec
- libs += Single_Service_stub Single_Service_lem_stub Large_Deployment_stub
+ libs += Single_Service_stub Single_Service_lem_stub Single_Service_Common_stub
libpaths += ../lib
libout = ../lib
includes += ..
@@ -106,16 +106,16 @@ project(Single_Service_exec) : ciao_executor {
}
-project(Single_Service_svnt) : ciao_servant {
- after += Single_Service_lem_stub
+project(Single_Service_svnt) : ciao_servant {
+ after += Single_Service_lem_stub Single_Service_Common_svnt
sharedname = Single_Service_svnt
libs += Single_Service_stub Single_Service_lem_stub \
- Large_Deployment_stub
+ Single_Service_Common_svnt
libpaths += ../lib
libout = ../lib
includes += ..
dynamicflags += SINGLE_SERVICE_SVNT_BUILD_DLL
-
+
IDL_Files {
}
diff --git a/CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.cpp b/CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.cpp
index 9074fb4e3b7..2b1e1e624cf 100644
--- a/CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.cpp
+++ b/CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.cpp
@@ -62,7 +62,7 @@ namespace CIAO_Shapes_Sender_Impl
max_y_ (0),
max_size_ (0),
resize_shape_ (false),
- ShapeNr (0)
+ TypeOfShape (SHAPE_TYPE_SQUARE)
{
this->ticker_ = new pulse_Generator (*this);
this->square_ = new ShapeType;
@@ -101,42 +101,59 @@ namespace CIAO_Shapes_Sender_Impl
{
try
{
- if (this->ShapeNr == 0)
+ ::Shapes::DDS_Typed::Writer_var writer;
+ if (this->TypeOfShape == SHAPE_TYPE_CIRCLE)
{
- this->ShapeNr = 1;
- this->writer_sq_->write_one (*square_,
- this->instance_handle_sq_);
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UPDATED Shape_info Square for <%C> %u:%u:%u\n"),
- this->square_->color.in (),
- this->square_->x,
- this->square_->y,
- this->square_->shapesize));
+ writer = this->ciao_context_->get_connection_info_write_sq_data ();
}
- else if (this->ShapeNr == 1)
+ else if (this->TypeOfShape == SHAPE_TYPE_TRIANGLE)
{
- this->ShapeNr = 2;
- this->writer_tr_->write_one (*triangle_,
- this->instance_handle_tr_);
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UPDATED Shape_info Triangle for <%C> %u:%u:%u\n"),
- this->triangle_->color.in (),
- this->triangle_->x,
- this->triangle_->y,
- this->triangle_->shapesize));
+ writer = this->ciao_context_->get_connection_info_write_tr_data ();
}
- else if (this->ShapeNr == 2)
+ else if (this->TypeOfShape == SHAPE_TYPE_CIRCLE)
{
- this->ShapeNr = 0;
- this->writer_cl_->write_one (*circle_,
- this->instance_handle_cq_);
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UPDATED Shape_info Circle for <%C> %u:%u:%u\n"),
- this->circle_->color.in (),
- this->circle_->x,
- this->circle_->y,
- this->circle_->shapesize));
- }
+ writer = this->ciao_context_->get_connection_info_write_cl_data ();
+ }
+ if (::CORBA::is_nil (writer.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Sender_exec_i::tick () - "
+ "ERROR: Unable to get connection to writer\n"));
+ return;
+ }
+
+ if (this->TypeOfShape == SHAPE_TYPE_CIRCLE)
+ {
+ this->TypeOfShape = SHAPE_TYPE_TRIANGLE;
+ writer->write_one (*square_, ::DDS::HANDLE_NIL);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UPDATED Shape_info Square for <%C> %u:%u:%u\n"),
+ this->square_->color.in (),
+ this->square_->x,
+ this->square_->y,
+ this->square_->shapesize));
+ }
+ else if (this->TypeOfShape == SHAPE_TYPE_TRIANGLE)
+ {
+ this->TypeOfShape = SHAPE_TYPE_CIRCLE;
+ writer->write_one (*triangle_, ::DDS::HANDLE_NIL);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UPDATED Shape_info Triangle for <%C> %u:%u:%u\n"),
+ this->triangle_->color.in (),
+ this->triangle_->x,
+ this->triangle_->y,
+ this->triangle_->shapesize));
+ }
+ else if (this->TypeOfShape == SHAPE_TYPE_CIRCLE)
+ {
+ this->TypeOfShape = SHAPE_TYPE_SQUARE;
+ writer->write_one (*circle_, ::DDS::HANDLE_NIL);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UPDATED Shape_info Circle for <%C> %u:%u:%u\n"),
+ this->circle_->color.in (),
+ this->circle_->x,
+ this->circle_->y,
+ this->circle_->shapesize));
+ }
}
catch (const CCM_DDS::NonExistent& )
{
@@ -245,29 +262,6 @@ namespace CIAO_Shapes_Sender_Impl
this->reactor ()->cancel_timer (this->ticker_);
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n")));
- try
- {
- this->writer_sq_->unregister_instance (*this->square_,
- this->instance_handle_sq_);
- this->writer_tr_->unregister_instance (*this->triangle_,
- this->instance_handle_tr_);
- this->writer_cl_->unregister_instance (*this->circle_,
- this->instance_handle_cq_);
- }
- catch (const CCM_DDS::NonExistent& )
- {
- //TODO: mentioning the correct shape in log message
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("Shape_info for <%C> not deleted: <%C> didn't exist.\n"),
- square_->color.in (), square_->color.in ()));
- }
- catch (const CCM_DDS::InternalError& )
- {
- //TODO: mentioning the correct shape in log message
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("Internal Error while deleting Shape_info for <%C>.\n"),
- square_->color.in ()));
- }
delete this->ticker_;
delete this->square_;
delete this->triangle_;
@@ -291,24 +285,7 @@ namespace CIAO_Shapes_Sender_Impl
void
Sender_exec_i::configuration_complete (void)
{
- this->writer_sq_ = this->ciao_context_->get_connection_info_write_sq_data ();
- this->writer_tr_ = this->ciao_context_->get_connection_info_write_tr_data ();
- this->writer_cl_ = this->ciao_context_->get_connection_info_write_cl_data ();
-
- if (::CORBA::is_nil (this->writer_sq_.in ()) ||
- ::CORBA::is_nil (this->writer_tr_.in ()) ||
- ::CORBA::is_nil (this->writer_cl_.in ()) )
- {
- ACE_ERROR ((LM_ERROR, "Sender_exec_i::configuration_complete - "
- "Unable to get connections to data writers.\n"));
- throw ::CORBA::INTERNAL ();
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::configuration_complete - "
- "Retrieved data writers\n"));
- }
- }
+ }
void
Sender_exec_i::ccm_activate (void)
@@ -334,24 +311,6 @@ namespace CIAO_Shapes_Sender_Impl
square_->x,
square_->y,
square_->shapesize));
- try
- {
- this->instance_handle_sq_ = this->writer_sq_->register_instance (*this->square_);
- this->instance_handle_tr_ = this->writer_tr_->register_instance (*this->triangle_);
- this->instance_handle_cq_ = this->writer_cl_->register_instance (*this->circle_);
- }
- catch (const CCM_DDS::AlreadyCreated& )
- {
- //TODO: mentioning the correct shape in log message
- ACE_ERROR ((LM_ERROR, ACE_TEXT ("Shape_info for <%C> already created.\n"),
- this->square_->color.in ()));
- }
- catch (const CCM_DDS::InternalError& )
- {
- //TODO: mentioning the correct shape in log message
- ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while creating Shape_info for <%C>.\n"),
- this->square_->color.in ()));
- }
this->start ();
}
diff --git a/CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.h b/CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.h
index 1b2687c3c1d..55ba006b059 100644
--- a/CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.h
+++ b/CIAO/connectors/dds4ccm/tests/MultiTopic/Sender/MultiTopic_Sender_exec.h
@@ -70,6 +70,11 @@ namespace CIAO_Shapes_Sender_Impl
//@{
/** Supported operations and attributes. */
+ enum TYPE_OF_SHAPE {
+ SHAPE_TYPE_SQUARE,
+ SHAPE_TYPE_TRIANGLE,
+ SHAPE_TYPE_CIRCLE
+ };
//@}
@@ -115,21 +120,12 @@ namespace CIAO_Shapes_Sender_Impl
private:
::Shapes::CCM_Sender_Context_var ciao_context_;
- ::Shapes::DDS_Typed::Writer_var writer_sq_;
- ::Shapes::DDS_Typed::Writer_var writer_tr_;
- ::Shapes::DDS_Typed::Writer_var writer_cl_;
ShapeType* square_;
ShapeType* triangle_;
ShapeType* circle_;
pulse_Generator * ticker_;
- ::DDS::InstanceHandle_t instance_handle_sq_;
- ::DDS::InstanceHandle_t instance_handle_tr_;
- ::DDS::InstanceHandle_t instance_handle_cq_;
-
-
-
//@{
/** Component attributes. */
@@ -146,7 +142,7 @@ namespace CIAO_Shapes_Sender_Impl
//@{
/** User defined members. */
- CORBA::UShort ShapeNr;
+ TYPE_OF_SHAPE TypeOfShape;
//@}
//@{