diff options
Diffstat (limited to 'modules/CIAO/ciao/Valuetype_Factories')
-rw-r--r-- | modules/CIAO/ciao/Valuetype_Factories/ConfigValue.cpp | 43 | ||||
-rw-r--r-- | modules/CIAO/ciao/Valuetype_Factories/ConfigValue.h | 38 | ||||
-rw-r--r-- | modules/CIAO/ciao/Valuetype_Factories/ConfigValue_Export.h | 58 | ||||
-rw-r--r-- | modules/CIAO/ciao/Valuetype_Factories/Cookie_Export.h | 58 | ||||
-rw-r--r-- | modules/CIAO/ciao/Valuetype_Factories/Cookies.cpp | 68 | ||||
-rw-r--r-- | modules/CIAO/ciao/Valuetype_Factories/Cookies.h | 70 | ||||
-rw-r--r-- | modules/CIAO/ciao/Valuetype_Factories/Cookies.inl | 10 | ||||
-rw-r--r-- | modules/CIAO/ciao/Valuetype_Factories/Factories.mpc | 23 |
8 files changed, 368 insertions, 0 deletions
diff --git a/modules/CIAO/ciao/Valuetype_Factories/ConfigValue.cpp b/modules/CIAO/ciao/Valuetype_Factories/ConfigValue.cpp new file mode 100644 index 00000000000..30a12b438b3 --- /dev/null +++ b/modules/CIAO/ciao/Valuetype_Factories/ConfigValue.cpp @@ -0,0 +1,43 @@ +// $Id$ +#include "ConfigValue.h" + +ACE_RCSID (ciao, + ConfigValue, + "$Id$") + +namespace CIAO +{ + ConfigValue_impl::ConfigValue_impl() + { + CORBA::Any any; + any <<= CORBA::Short(0); + name((const char*)""); + value(any); + } + + + ConfigValue_impl::ConfigValue_impl(const char* the_name, + const CORBA::Any& the_value) + : OBV_Components::ConfigValue() + { + CORBA::Any any = the_value; + name( the_name ); + value( any ); + } + + CORBA::ValueBase* ConfigValue_impl::_copy_value() + { + return new ConfigValue_impl(name(),value()); + } + + ConfigValue_impl::~ConfigValue_impl() + throw () + { + } + + CORBA::ValueBase * + ConfigValueFactory::create_for_unmarshal () + { + return new ConfigValue_impl(); + } +} diff --git a/modules/CIAO/ciao/Valuetype_Factories/ConfigValue.h b/modules/CIAO/ciao/Valuetype_Factories/ConfigValue.h new file mode 100644 index 00000000000..3592c045f79 --- /dev/null +++ b/modules/CIAO/ciao/Valuetype_Factories/ConfigValue.h @@ -0,0 +1,38 @@ +// $Id$ + + +#ifndef CIAO_CONFIG_VALUE_H +#define CIAO_CONFIG_VALUE_H +#include /**/ "ace/pre.h" + +#include "ccm/CCM_StandardConfiguratorC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ConfigValue_Export.h" +// #include "ace/Active_Map_Manager.h" + +namespace CIAO +{ + class ConfigValue_Factory_Export ConfigValue_impl + : public virtual OBV_Components::ConfigValue, + public virtual CORBA::DefaultValueRefCountBase + { + public: + ConfigValue_impl(); + ConfigValue_impl(const char* the_name, const CORBA::Any& the_value); + ~ConfigValue_impl() throw(); + virtual CORBA::ValueBase* _copy_value(); + }; + + class ConfigValueFactory : virtual public Components::ConfigValue_init + { + public: + CORBA::ValueBase * create_for_unmarshal (); + }; +} + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_VALUE_H */ diff --git a/modules/CIAO/ciao/Valuetype_Factories/ConfigValue_Export.h b/modules/CIAO/ciao/Valuetype_Factories/ConfigValue_Export.h new file mode 100644 index 00000000000..71ec6ce9491 --- /dev/null +++ b/modules/CIAO/ciao/Valuetype_Factories/ConfigValue_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ConfigValue_Factory +// ------------------------------ +#ifndef CONFIGVALUE_FACTORY_EXPORT_H +#define CONFIGVALUE_FACTORY_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CONFIGVALUE_FACTORY_HAS_DLL) +# define CONFIGVALUE_FACTORY_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CONFIGVALUE_FACTORY_HAS_DLL */ + +#if !defined (CONFIGVALUE_FACTORY_HAS_DLL) +# define CONFIGVALUE_FACTORY_HAS_DLL 1 +#endif /* ! CONFIGVALUE_FACTORY_HAS_DLL */ + +#if defined (CONFIGVALUE_FACTORY_HAS_DLL) && (CONFIGVALUE_FACTORY_HAS_DLL == 1) +# if defined (CONFIGVALUE_FACTORY_BUILD_DLL) +# define ConfigValue_Factory_Export ACE_Proper_Export_Flag +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CONFIGVALUE_FACTORY_BUILD_DLL */ +# define ConfigValue_Factory_Export ACE_Proper_Import_Flag +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CONFIGVALUE_FACTORY_BUILD_DLL */ +#else /* CONFIGVALUE_FACTORY_HAS_DLL == 1 */ +# define ConfigValue_Factory_Export +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARATION(T) +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CONFIGVALUE_FACTORY_HAS_DLL == 1 */ + +// Set CONFIGVALUE_FACTORY_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CONFIGVALUE_FACTORY_NTRACE) +# if (ACE_NTRACE == 1) +# define CONFIGVALUE_FACTORY_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CONFIGVALUE_FACTORY_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CONFIGVALUE_FACTORY_NTRACE */ + +#if (CONFIGVALUE_FACTORY_NTRACE == 1) +# define CONFIGVALUE_FACTORY_TRACE(X) +#else /* (CONFIGVALUE_FACTORY_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CONFIGVALUE_FACTORY_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CONFIGVALUE_FACTORY_NTRACE == 1) */ + +#endif /* CONFIGVALUE_FACTORY_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/ciao/Valuetype_Factories/Cookie_Export.h b/modules/CIAO/ciao/Valuetype_Factories/Cookie_Export.h new file mode 100644 index 00000000000..277717f4d5c --- /dev/null +++ b/modules/CIAO/ciao/Valuetype_Factories/Cookie_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Cookie_Factory +// ------------------------------ +#ifndef COOKIE_FACTORY_EXPORT_H +#define COOKIE_FACTORY_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (COOKIE_FACTORY_HAS_DLL) +# define COOKIE_FACTORY_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && COOKIE_FACTORY_HAS_DLL */ + +#if !defined (COOKIE_FACTORY_HAS_DLL) +# define COOKIE_FACTORY_HAS_DLL 1 +#endif /* ! COOKIE_FACTORY_HAS_DLL */ + +#if defined (COOKIE_FACTORY_HAS_DLL) && (COOKIE_FACTORY_HAS_DLL == 1) +# if defined (COOKIE_FACTORY_BUILD_DLL) +# define Cookie_Factory_Export ACE_Proper_Export_Flag +# define COOKIE_FACTORY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define COOKIE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* COOKIE_FACTORY_BUILD_DLL */ +# define Cookie_Factory_Export ACE_Proper_Import_Flag +# define COOKIE_FACTORY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define COOKIE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* COOKIE_FACTORY_BUILD_DLL */ +#else /* COOKIE_FACTORY_HAS_DLL == 1 */ +# define Cookie_Factory_Export +# define COOKIE_FACTORY_SINGLETON_DECLARATION(T) +# define COOKIE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* COOKIE_FACTORY_HAS_DLL == 1 */ + +// Set COOKIE_FACTORY_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (COOKIE_FACTORY_NTRACE) +# if (ACE_NTRACE == 1) +# define COOKIE_FACTORY_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define COOKIE_FACTORY_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !COOKIE_FACTORY_NTRACE */ + +#if (COOKIE_FACTORY_NTRACE == 1) +# define COOKIE_FACTORY_TRACE(X) +#else /* (COOKIE_FACTORY_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define COOKIE_FACTORY_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (COOKIE_FACTORY_NTRACE == 1) */ + +#endif /* COOKIE_FACTORY_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/ciao/Valuetype_Factories/Cookies.cpp b/modules/CIAO/ciao/Valuetype_Factories/Cookies.cpp new file mode 100644 index 00000000000..0d32ffe9d89 --- /dev/null +++ b/modules/CIAO/ciao/Valuetype_Factories/Cookies.cpp @@ -0,0 +1,68 @@ +// $Id$ + +#include "Cookies.h" + +#if !defined (__ACE_INLINE__) +#include "Cookies.inl" +#endif /* !defined INLINE */ + +ACE_RCSID (ciao, + Cookies, + "$Id$") + +namespace CIAO +{ + Cookie_Impl::Cookie_Impl (ptrdiff_t const &key) + { + this->cookieValue ().length (sizeof (ptrdiff_t)); + ACE_OS::memcpy (this->cookieValue ().get_buffer (false), + &key, + sizeof (ptrdiff_t)); + } + + Cookie_Impl::~Cookie_Impl (void) + { + } + + bool + Cookie_Impl::extract (Components::Cookie const * const ck, + ptrdiff_t &key) + { + Cookie_Impl const * const c = + dynamic_cast <Cookie_Impl const *> (ck); + + if (c == 0) + { + return false; + } + + CORBA::OctetSeq const &x = c->cookieValue (); + + if (x.length () != sizeof (ptrdiff_t)) + { + return false; + } + + key = *reinterpret_cast<const ptrdiff_t*> (x.get_buffer ()); + + return true; + } + + //======================================================== + + CORBA::ValueBase * + Cookie_Impl_init::create_for_unmarshal (void) + { + CORBA::ValueBase *ret_val = 0; + + ACE_NEW_THROW_EX (ret_val, + CIAO::Cookie_Impl, + CORBA::NO_MEMORY ()); + + return ret_val; + } + + Cookie_Impl_init::~Cookie_Impl_init (void) + { + } +} diff --git a/modules/CIAO/ciao/Valuetype_Factories/Cookies.h b/modules/CIAO/ciao/Valuetype_Factories/Cookies.h new file mode 100644 index 00000000000..8fd92b348f8 --- /dev/null +++ b/modules/CIAO/ciao/Valuetype_Factories/Cookies.h @@ -0,0 +1,70 @@ +// $Id$ + +/** + * @file Cookies.h + * + * A CIAO implementation of Cookie valuetype. + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ + +#ifndef CIAO_COOKIES_H +#define CIAO_COOKIES_H + +#include /**/ "ace/pre.h" + +#include "Cookie_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ccm/CCM_CookieC.h" + +#include "ace/Active_Map_Manager.h" + +namespace CIAO +{ + /** + * @class Cookie_Impl + * + * @brief A cookie implementation using an unsigned integer + * big enough to hold an address, even on a 64-bit machine. + */ + class Cookie_Factory_Export Cookie_Impl + : public virtual OBV_Components::Cookie + { + public: + Cookie_Impl (void); + virtual ~Cookie_Impl (void); + + /// Initialize a @c Cookie with a @c ptrdiff_t + Cookie_Impl (ptrdiff_t const &key); + + /// Extract the @c CORBA::ULong + static bool extract (Components::Cookie const * const c, + ptrdiff_t &key); + }; + + /** + * @class Cookie_Impl_init + * + * @brief Valuefactory implementation for Cookie_Impl. + */ + class Cookie_Factory_Export Cookie_Impl_init + : public virtual Components::Cookie_init + { + public: + virtual ~Cookie_Impl_init (void); + + virtual CORBA::ValueBase *create_for_unmarshal (void); + }; +} + +#if defined (__ACE_INLINE__) +#include "Cookies.inl" +#endif /* defined INLINE */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_COOKIES_H */ diff --git a/modules/CIAO/ciao/Valuetype_Factories/Cookies.inl b/modules/CIAO/ciao/Valuetype_Factories/Cookies.inl new file mode 100644 index 00000000000..406485110c4 --- /dev/null +++ b/modules/CIAO/ciao/Valuetype_Factories/Cookies.inl @@ -0,0 +1,10 @@ +/* -*- C++ -*- */ +// $Id$ + +namespace CIAO +{ + ACE_INLINE + Cookie_Impl::Cookie_Impl (void) + { + } +} diff --git a/modules/CIAO/ciao/Valuetype_Factories/Factories.mpc b/modules/CIAO/ciao/Valuetype_Factories/Factories.mpc new file mode 100644 index 00000000000..c03e88e1ec8 --- /dev/null +++ b/modules/CIAO/ciao/Valuetype_Factories/Factories.mpc @@ -0,0 +1,23 @@ +//$Id$ +project(CCM_Cookie_Factory) : ccm_stub, ciao_lib { + dynamicflags = COOKIE_FACTORY_BUILD_DLL + Source_Files { + Cookies.cpp + } + Header_Files { + Cookies.h + } + Inline_Files { + Cookies.inl + } +} + +project(CCM_ConfigValue_Factory) : ccm_stub, ciao_lib { + dynamicflags = CONFIGVALUE_FACTORY_BUILD_DLL + Source_Files { + ConfigValue.cpp + } + Header_Files { + ConfigValue.h + } +} |