diff options
Diffstat (limited to 'modules/CIAO/examples/Display/NavDisplay')
8 files changed, 555 insertions, 0 deletions
diff --git a/modules/CIAO/examples/Display/NavDisplay/NavDisplay.cidl b/modules/CIAO/examples/Display/NavDisplay/NavDisplay.cidl new file mode 100644 index 00000000000..5a277fe50f5 --- /dev/null +++ b/modules/CIAO/examples/Display/NavDisplay/NavDisplay.cidl @@ -0,0 +1,12 @@ +// $Id$ -*- IDL -*- + +#include "NavDisplay.idl" + +composition session NavDisplay_Impl +{ + home executor NavDisplayHome_exec + { + implements HUDisplay::NavDisplayHome; + manages NavDisplay_exec; + }; +}; diff --git a/modules/CIAO/examples/Display/NavDisplay/NavDisplay.idl b/modules/CIAO/examples/Display/NavDisplay/NavDisplay.idl new file mode 100644 index 00000000000..a786f7f9d06 --- /dev/null +++ b/modules/CIAO/examples/Display/NavDisplay/NavDisplay.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file NavDisplay.idl + * + * Definition of the navigation display component. + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ + +#ifndef NAVDISPLAY_IDL +#define NAVDISPLAY_IDL + +#include "../Display_Base/Display_Base.idl" + +module HUDisplay +{ + component NavDisplay + { + consumes tick Refresh; + uses position GPSLocation; + }; + + home NavDisplayHome manages NavDisplay + { + }; +}; + +#endif /* NAVDISPLAY_IDL */ diff --git a/modules/CIAO/examples/Display/NavDisplay/NavDisplay.mpc b/modules/CIAO/examples/Display/NavDisplay/NavDisplay.mpc new file mode 100644 index 00000000000..a3ee533d6f5 --- /dev/null +++ b/modules/CIAO/examples/Display/NavDisplay/NavDisplay.mpc @@ -0,0 +1,83 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p Display_Base NavDisplay" + +project(Display_Base_NavDisplay_stub): ciao_client_dnc { + after += Display_Base_stub + sharedname = NavDisplay_stub + libs += Display_Base_stub + idlflags += -St \ + -Wb,stub_export_macro=NAVDISPLAY_STUB_Export \ + -Wb,stub_export_include=NavDisplay_stub_export.h \ + -Wb,skel_export_macro=NAVDISPLAY_SVNT_Export \ + -Wb,skel_export_include=NavDisplay_svnt_export.h + dynamicflags = NAVDISPLAY_STUB_BUILD_DLL + + IDL_Files { + NavDisplay.idl + } + + Source_Files { + NavDisplayC.cpp + } + + Header_Files { + NavDisplay_stub_export.h + } +} + +project(Display_Base_NavDisplay_svnt) : ciao_servant_dnc { + after += Display_Base_skel Display_Base_NavDisplay_stub + sharedname = NavDisplay_svnt + libs += NavDisplay_stub \ + Display_Base_stub \ + Display_Base_skel + + idlflags += -SS -St \ + -Wb,export_macro=NAVDISPLAY_SVNT_Export \ + -Wb,export_include=NavDisplay_svnt_export.h + dynamicflags = NAVDISPLAY_SVNT_BUILD_DLL + + CIDL_Files { + NavDisplay.cidl + } + + IDL_Files { + NavDisplayE.idl + } + + Source_Files { + NavDisplayEC.cpp + NavDisplayS.cpp + NavDisplay_svnt.cpp + } + + Header_Files { + NavDisplay_svnt_export.h + } +} + + +project(Display_Base_NavDisplay_exec) : ciao_component_dnc { + after += Display_Base_NavDisplay_svnt + sharedname = NavDisplay_exec + libs += NavDisplay_stub \ + NavDisplay_svnt \ + Display_Base_stub \ + Display_Base_skel + + dynamicflags = NAVDISPLAY_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NavDisplay_exec.cpp + } + + Header_Files { + NavDisplay_exec_export.h + } +} + + + diff --git a/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec.cpp b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec.cpp new file mode 100644 index 00000000000..06d1d8c213b --- /dev/null +++ b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec.cpp @@ -0,0 +1,148 @@ +// $Id$ + +#include "ciao/CIAO_common.h" +#include "NavDisplay_exec.h" + +/// Default constructor. +MyImpl::NavDisplay_exec_impl::NavDisplay_exec_impl () +{ +} + +/// Default destructor. +MyImpl::NavDisplay_exec_impl::~NavDisplay_exec_impl () +{ +} + +// Operations from HUDisplay::NavDisplay + +void +MyImpl::NavDisplay_exec_impl::push_Refresh (HUDisplay::tick *ev) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_UNUSED_ARG (ev); + +// ACE_DEBUG ((LM_DEBUG, +// ACE_TEXT ("NAVDISPLAY: Received Refresh Event\n"))); + + // Refresh position + HUDisplay::position_var loc = + this->context_->get_connection_GPSLocation (); + + if (CORBA::is_nil (loc.in ())) + { + throw CORBA::BAD_INV_ORDER (); + } + + CORBA::Long x = loc->posx () % 500; + + CORBA::Long y = loc->posy () % 300; + + ACE_DEBUG ((LM_DEBUG, "NAVDISPLAY: Current Location is: (%d, %d)\n", + x, + y)); +} + +// Operations from Components::SessionComponent +void +MyImpl::NavDisplay_exec_impl::set_session_context ( + Components::SessionContext_ptr ctx + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::NavDisplay_exec_impl::set_session_context\n")); + } + + this->context_ = + HUDisplay::CCM_NavDisplay_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw CORBA::INTERNAL (); + } + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::NavDisplay_exec_impl::ciao_preactivate ( + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::NavDisplay_exec_impl::ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::NavDisplay_exec_impl::ccm_activate\n")); + } +} + +void +MyImpl::NavDisplay_exec_impl::ciao_postactivate ( + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::NavDisplay_exec_impl::ccm_passivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::NavDisplay_exec_impl::ccm_passivate\n")); + } +} + +void +MyImpl::NavDisplay_exec_impl::ccm_remove () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::NavDisplay_exec_impl::ccm_remove\n")); + } +} + +/// Default ctor. +MyImpl::NavDisplayHome_exec_impl::NavDisplayHome_exec_impl () +{ +} + +/// Default dtor. +MyImpl::NavDisplayHome_exec_impl::~NavDisplayHome_exec_impl () +{ +} + +// Explicit home operations. + +// Implicit home operations. + +::Components::EnterpriseComponent_ptr +MyImpl::NavDisplayHome_exec_impl::create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + return new MyImpl::NavDisplay_exec_impl; +} + + +extern "C" NAVDISPLAY_EXEC_Export ::Components::HomeExecutorBase_ptr +createNavDisplayHome_Impl (void) +{ + return new MyImpl::NavDisplayHome_exec_impl; +} diff --git a/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec.h b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec.h new file mode 100644 index 00000000000..3c5ca68d40d --- /dev/null +++ b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec.h @@ -0,0 +1,109 @@ +// $Id$ + +/** + * @file NavDisplay_exec.h + * + * Header file for the actual NavDisplay and NavDisplayHome component + * implementations. + * + * @author Nanbor Wang <nanbor@cse.wustl.edu> + */ + +#ifndef NAVDISPLAY_EXEC_H +#define NAVDISPLAY_EXEC_H + +#include "NavDisplayEC.h" +#include "NavDisplay_exec_export.h" +#include "tao/LocalObject.h" + +namespace MyImpl +{ + /** + * @class NavDisplay_exec_impl + * + * RateGen executor implementation class. + */ + class NAVDISPLAY_EXEC_Export NavDisplay_exec_impl : + public virtual CIDL_NavDisplay_Impl::NavDisplay_exec, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + NavDisplay_exec_impl (); + + /// Default destructor. + ~NavDisplay_exec_impl (); + + // Operations from HUDisplay::NavDisplay + + virtual void + push_Refresh (HUDisplay::tick *ev) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // 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 + ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ciao_postactivate () + 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: + /// Copmponent specific context + HUDisplay::CCM_NavDisplay_Context_var context_; + }; + + /** + * @class NavDisplayHome_exec_impl + * + * NavDisplay home executor implementation class. + */ + class NAVDISPLAY_EXEC_Export NavDisplayHome_exec_impl : + public virtual HUDisplay::CCM_NavDisplayHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + NavDisplayHome_exec_impl (); + + /// Default dtor. + ~NavDisplayHome_exec_impl (); + + // Explicit home operations. + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + }; + +} + +extern "C" NAVDISPLAY_EXEC_Export ::Components::HomeExecutorBase_ptr +createNavDisplayHome_Impl (void); + +#endif /* NAVDISPLAY_EXEC_H */ diff --git a/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec_export.h b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec_export.h new file mode 100644 index 00000000000..aec244fc913 --- /dev/null +++ b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl NAVDISPLAY_EXEC +// ------------------------------ +#ifndef NAVDISPLAY_EXEC_EXPORT_H +#define NAVDISPLAY_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (NAVDISPLAY_EXEC_HAS_DLL) +# define NAVDISPLAY_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && NAVDISPLAY_EXEC_HAS_DLL */ + +#if !defined (NAVDISPLAY_EXEC_HAS_DLL) +# define NAVDISPLAY_EXEC_HAS_DLL 1 +#endif /* ! NAVDISPLAY_EXEC_HAS_DLL */ + +#if defined (NAVDISPLAY_EXEC_HAS_DLL) && (NAVDISPLAY_EXEC_HAS_DLL == 1) +# if defined (NAVDISPLAY_EXEC_BUILD_DLL) +# define NAVDISPLAY_EXEC_Export ACE_Proper_Export_Flag +# define NAVDISPLAY_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define NAVDISPLAY_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* NAVDISPLAY_EXEC_BUILD_DLL */ +# define NAVDISPLAY_EXEC_Export ACE_Proper_Import_Flag +# define NAVDISPLAY_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define NAVDISPLAY_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* NAVDISPLAY_EXEC_BUILD_DLL */ +#else /* NAVDISPLAY_EXEC_HAS_DLL == 1 */ +# define NAVDISPLAY_EXEC_Export +# define NAVDISPLAY_EXEC_SINGLETON_DECLARATION(T) +# define NAVDISPLAY_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* NAVDISPLAY_EXEC_HAS_DLL == 1 */ + +// Set NAVDISPLAY_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (NAVDISPLAY_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define NAVDISPLAY_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define NAVDISPLAY_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !NAVDISPLAY_EXEC_NTRACE */ + +#if (NAVDISPLAY_EXEC_NTRACE == 1) +# define NAVDISPLAY_EXEC_TRACE(X) +#else /* (NAVDISPLAY_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define NAVDISPLAY_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (NAVDISPLAY_EXEC_NTRACE == 1) */ + +#endif /* NAVDISPLAY_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/Display/NavDisplay/NavDisplay_stub_export.h b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_stub_export.h new file mode 100644 index 00000000000..957975fb857 --- /dev/null +++ b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl NAVDISPLAY_STUB +// ------------------------------ +#ifndef NAVDISPLAY_STUB_EXPORT_H +#define NAVDISPLAY_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (NAVDISPLAY_STUB_HAS_DLL) +# define NAVDISPLAY_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && NAVDISPLAY_STUB_HAS_DLL */ + +#if !defined (NAVDISPLAY_STUB_HAS_DLL) +# define NAVDISPLAY_STUB_HAS_DLL 1 +#endif /* ! NAVDISPLAY_STUB_HAS_DLL */ + +#if defined (NAVDISPLAY_STUB_HAS_DLL) && (NAVDISPLAY_STUB_HAS_DLL == 1) +# if defined (NAVDISPLAY_STUB_BUILD_DLL) +# define NAVDISPLAY_STUB_Export ACE_Proper_Export_Flag +# define NAVDISPLAY_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define NAVDISPLAY_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* NAVDISPLAY_STUB_BUILD_DLL */ +# define NAVDISPLAY_STUB_Export ACE_Proper_Import_Flag +# define NAVDISPLAY_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define NAVDISPLAY_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* NAVDISPLAY_STUB_BUILD_DLL */ +#else /* NAVDISPLAY_STUB_HAS_DLL == 1 */ +# define NAVDISPLAY_STUB_Export +# define NAVDISPLAY_STUB_SINGLETON_DECLARATION(T) +# define NAVDISPLAY_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* NAVDISPLAY_STUB_HAS_DLL == 1 */ + +// Set NAVDISPLAY_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (NAVDISPLAY_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define NAVDISPLAY_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define NAVDISPLAY_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !NAVDISPLAY_STUB_NTRACE */ + +#if (NAVDISPLAY_STUB_NTRACE == 1) +# define NAVDISPLAY_STUB_TRACE(X) +#else /* (NAVDISPLAY_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define NAVDISPLAY_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (NAVDISPLAY_STUB_NTRACE == 1) */ + +#endif /* NAVDISPLAY_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/Display/NavDisplay/NavDisplay_svnt_export.h b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_svnt_export.h new file mode 100644 index 00000000000..752b31a8ac8 --- /dev/null +++ b/modules/CIAO/examples/Display/NavDisplay/NavDisplay_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl NAVDISPLAY_SVNT +// ------------------------------ +#ifndef NAVDISPLAY_SVNT_EXPORT_H +#define NAVDISPLAY_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (NAVDISPLAY_SVNT_HAS_DLL) +# define NAVDISPLAY_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && NAVDISPLAY_SVNT_HAS_DLL */ + +#if !defined (NAVDISPLAY_SVNT_HAS_DLL) +# define NAVDISPLAY_SVNT_HAS_DLL 1 +#endif /* ! NAVDISPLAY_SVNT_HAS_DLL */ + +#if defined (NAVDISPLAY_SVNT_HAS_DLL) && (NAVDISPLAY_SVNT_HAS_DLL == 1) +# if defined (NAVDISPLAY_SVNT_BUILD_DLL) +# define NAVDISPLAY_SVNT_Export ACE_Proper_Export_Flag +# define NAVDISPLAY_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define NAVDISPLAY_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* NAVDISPLAY_SVNT_BUILD_DLL */ +# define NAVDISPLAY_SVNT_Export ACE_Proper_Import_Flag +# define NAVDISPLAY_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define NAVDISPLAY_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* NAVDISPLAY_SVNT_BUILD_DLL */ +#else /* NAVDISPLAY_SVNT_HAS_DLL == 1 */ +# define NAVDISPLAY_SVNT_Export +# define NAVDISPLAY_SVNT_SINGLETON_DECLARATION(T) +# define NAVDISPLAY_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* NAVDISPLAY_SVNT_HAS_DLL == 1 */ + +// Set NAVDISPLAY_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (NAVDISPLAY_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define NAVDISPLAY_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define NAVDISPLAY_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !NAVDISPLAY_SVNT_NTRACE */ + +#if (NAVDISPLAY_SVNT_NTRACE == 1) +# define NAVDISPLAY_SVNT_TRACE(X) +#else /* (NAVDISPLAY_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define NAVDISPLAY_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (NAVDISPLAY_SVNT_NTRACE == 1) */ + +#endif /* NAVDISPLAY_SVNT_EXPORT_H */ + +// End of auto generated file. |