From efec2486501a09c2f464e8d6e2c979f78600f343 Mon Sep 17 00:00:00 2001 From: nanbor Date: Wed, 12 Mar 2003 04:51:46 +0000 Subject: *** empty log message *** --- TAO/CIAO/ChangeLog | 19 ++++++- .../docs/templates/CIAO_Glue_Session_Template.cpp | 6 ++ .../docs/templates/CIAO_Glue_Session_Template.h | 18 +++--- .../docs/templates/CIAO_Glue_Session_Template.inl | 6 ++ .../examples/handcrafted/Display/HUDisplayE.idl | 1 - .../handcrafted/Display/HUDisplay_svnt.cpp | 13 +++++ .../examples/handcrafted/Display/HUDisplay_svnt.h | 66 ++++++++++++++++++++++ .../handcrafted/Display/HUDisplay_svnt.inl | 32 +++++++++++ 8 files changed, 149 insertions(+), 12 deletions(-) create mode 100644 TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.cpp create mode 100644 TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.h create mode 100644 TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.inl diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 0f670d8723c..67fbe7ea3a0 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,6 +1,21 @@ -Tue Mar 11 15:18:52 2003 Nanbor Wang +Tue Mar 11 22:47:06 2003 Nanbor Wang + + * examples/handcrafted/Display/HUDisplayE.idl: Removed redundant + operations that have already been defined in the facet interface. + + * examples/handcrafted/Display/HUDisplay_svnt.cpp: + * examples/handcrafted/Display/HUDisplay_svnt.h: + * examples/handcrafted/Display/HUDisplay_svnt.inl: Added hand + generated code based on the glue code template in + + docs/templates/ -Tue Mar 11 14:55:50 2003 Nanbor Wang + * docs/templates/CIAO_Glue_Session_Template.cpp: + * docs/templates/CIAO_Glue_Session_Template.h: + * docs/templates/CIAO_Glue_Session_Template.inl: Updated template + code based on results from hand generated code. + +Tue Mar 11 15:18:52 2003 Nanbor Wang * bin/generate_component_mpc.pl: Added this new to auto-generate the mpc files for a single component implementation. The mpc diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp index ba9fd00ceab..39640c41cb4 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp @@ -6,6 +6,12 @@ // @@ Notice: [ciao module name] can expand to either CIAO_GLUE or // CIAO_GLUE_[module name] as defined in the header file. +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +/// @@@ Notice that all component and interface names need to be +/// fully qualified as we are creating a new namespace for the CIAO's +/// container glue code. +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + #include "[idl-basename]GS.h" #if !defined (__ACE_INLINE__) diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h index f98d4c62276..9a55d4b382a 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h @@ -9,14 +9,14 @@ // implementation for a session component should look like. // // The generated filename for files using this template shoule be -// [idl-basename]GS.h GS --> GlueSession +// [idl-basename]_svnt.h // // @author Nanbor Wang // // =========================================================== -#ifndef CIAO_GLUE_SESSION_[idl-basename]GS_H -#define CIAO_GLUE_SESSION_[idl-basename]GS_H +#ifndef CIAO_GLUE_SESSION_[idl-basename]_SVNT_H +#define CIAO_GLUE_SESSION_[idl-basename]_SVNT_H #include "ace/pre.h" #include "[idl-name]S.h" // Source in the skeletons for component @@ -24,16 +24,16 @@ #include "[idl-name]EC.h" // Source in the executor mapping // that component implementations use #include "ciao/Container_Base.h" //Source in the container interface definitions -#include "[SERVANT]_export.h" // Generated export decl #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -/// @@@ Notice that all component and interface names may need to be +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +/// @@@ Notice that all component and interface names need to be /// fully qualified as we are creating a new namespace for the CIAO's /// container glue code. - +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ##if component is defined withing a [module name] namespace CIAO_GLUE_[module_name] @@ -60,7 +60,7 @@ namespace CIAO_GLUE public: // Constructor and destructor. [facet type]_Servant (CCM_[facet type]_ptr executor, - ::Components::CCMContext_ptr ctx_); + ::Components::CCMContext_ptr ctx); ~[facet tyep]_Servant (); ## foreach [operation] in (all facet operations) @@ -620,9 +620,9 @@ namespace CIAO_GLUE #endif #if defined (__ACE_INLINE__) -# include "[idl-basename]GS.inl" +# include "[idl-basename]_SVNT.inl" #endif /* __ACE_INLINE__ */ #include "ace/post.h" -#endif /* CIAO_GLUE_SESSION_[idl-basename]GS_H */ +#endif /* CIAO_GLUE_SESSION_[idl-basename]_SVNT_H */ diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl index e93f1ab9c5a..cff99446301 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl @@ -6,6 +6,12 @@ // @@ Notice: [ciao module name] can expand to either CIAO_GLUE or // CIAO_GLUE_[module name] as defined in the header file. +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +/// @@@ Notice that all component and interface names need to be +/// fully qualified as we are creating a new namespace for the CIAO's +/// container glue code. +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + ////////////////////////////////////////////////////////////////// // Facet Glue Code implementation // @@ We are assuming that these facets are declared under the same diff --git a/TAO/CIAO/examples/handcrafted/Display/HUDisplayE.idl b/TAO/CIAO/examples/handcrafted/Display/HUDisplayE.idl index db5623f8e0f..b2e77190050 100644 --- a/TAO/CIAO/examples/handcrafted/Display/HUDisplayE.idl +++ b/TAO/CIAO/examples/handcrafted/Display/HUDisplayE.idl @@ -30,6 +30,5 @@ module HUDisplay */ local interface CCM_position : position { - long pos (); }; }; diff --git a/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.cpp b/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.cpp new file mode 100644 index 00000000000..4153af14621 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.cpp @@ -0,0 +1,13 @@ +// $Id$ + +// The generated filename for files using this template shoule be +// [idl-basename]GS.cpp GS --> GlueSession + +// @@ Notice: [ciao module name] can expand to either CIAO_GLUE or +// CIAO_GLUE_[module name] as defined in the header file. + +#include "HUDisplay_svnt.h" + +#if !defined (__ACE_INLINE__) +# include "HUDisplay_svnt.inl" +#endif /* __ACE_INLINE__ */ diff --git a/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.h b/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.h new file mode 100644 index 00000000000..6bd47abcfcf --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.h @@ -0,0 +1,66 @@ +// $Id$ + +// =========================================================== +// +// @file HUDisplay_svnt.h +// +// This is a pseudo-meta generic servant implementations template +// for CIAO's CIDL compiler. It demonstrates how a servant +// implementation for a session component should look like. +// +// The generated filename for files using this template shoule be +// [idl-basename]GS.h GS --> GlueSession +// +// @author Nanbor Wang +// +// =========================================================== + +#ifndef CIAO_GLUE_SESSION_HUDISPLAYGS_H +#define CIAO_GLUE_SESSION_HUDISPLAYGS_H +#include "ace/pre.h" + +#include "HUDisplayS.h" // Source in the skeletons for component + // client-view equivalent interfaces +#include "HUDisplayEC.h" // Source in the executor mapping + // that component implementations use +#include "ciao/Container_Base.h" //Source in the container interface definitions + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/// @@@ Notice that all component and interface names may need to be +/// fully qualified as we are creating a new namespace for the CIAO's +/// container glue code. + +namespace CIAO_GLUE_HUDisplay +{ + class HUDISPLAY_SVNT_Export position_Servant : + public virtual POA_HUDisplay::position, + public virtual PortableServer::RefCountServantBase + { + public: + position_Servant (HUDisplay::CCM_position_ptr executor, + Components::CCMContext_ptr ctx_); + + ~position_Servant (); + + virtual CORBA::Long pos (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Facet executor. + HUDisplay::CCM_position_var executor_; + + // Context object. + Components::CCMContext_var ctx_; + }; +} + +#if defined (__ACE_INLINE__) +# include "HUDisplay_svnt.inl" +#endif /* __ACE_INLINE__ */ + + +#include "ace/post.h" +#endif /* CIAO_GLUE_SESSION_HUDISPLAYGS_H */ diff --git a/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.inl b/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.inl new file mode 100644 index 00000000000..fc3ec25da3c --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/HUDisplay_svnt.inl @@ -0,0 +1,32 @@ +// $Id$ -*- C++ -*- + +// The generated filename for files using this template shoule be +// [idl-basename]GS.i GS --> GlueSession + +// @@ Notice: [ciao module name] can expand to either CIAO_GLUE or +// CIAO_GLUE_[module name] as defined in the header file. + +// Constructor and destructor. +ACE_INLINE +CIAO_GLUE_HUDisplay::position_Servant::position_Servant (HUDisplay::CCM_position_ptr executor, + Components::CCMContext_ptr c) + : executor_ (HUDisplay::CCM_position::_duplicate (executor)), + ctx_ (c) +{ +} + +ACE_INLINE +CIAO_GLUE_HUDisplay::position_Servant::~position_Servant () +{ +} + + +// This is only a guideline... we always relay the operation to underlying +// executor. + +ACE_INLINE CORBA::Long +CIAO_GLUE_HUDisplay::position_Servant::pos (ACE_ENV_SINGLE_ARG_DECL) +{ + // Simply relay to executor. May not need to return the result... + return this->executor_->pos (ACE_ENV_SINGLE_ARG_PARAMETER); +} -- cgit v1.2.1