📄 cospropertyservice_i.h
字号:
// -*- C++ -*-
//=============================================================================
/**
* @file CosPropertyService_i.h
*
* CosPropertyService_i.h,v 1.36 2003/08/18 06:42:14 ossama Exp
*
* @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
*/
//=============================================================================
#ifndef TAO_COSPROPERTYSERVICE_I_H
#define TAO_COSPROPERTYSERVICE_I_H
#include /**/ "ace/pre.h"
#include "orbsvcs/Property/property_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "orbsvcs/CosPropertyServiceS.h"
#include "ace/Hash_Map_Manager.h"
#include "ace/Null_Mutex.h"
// This is to remove "inherits via dominance" warnings from MSVC.
// MSVC is being a little too paranoid.
#if defined(_MSC_VER)
#if (_MSC_VER >= 1200)
#pragma warning(push)
#endif /* _MSC_VER >= 1200 */
#pragma warning(disable:4250)
#endif /* _MSC_VER */
// = Classes to deal with the ACE_Hash_Map_Manager.
class TAO_Property_Export CosProperty_Hash_Key
{
// = TITLE
// Key for the Hash Table. The EXT_ID of the
// ACE_Hash_Map_Manager.
public:
// = Initialization and termination methods.
CosProperty_Hash_Key (void);
// Default constructor.
CosProperty_Hash_Key (const char * &name);
// Constructor from a const string.
CosProperty_Hash_Key (const CosPropertyService::PropertyName &name);
// Costructor that takes PropertyName.
CosProperty_Hash_Key (const CosProperty_Hash_Key &hash_key);
// Copy constructor.
virtual ~CosProperty_Hash_Key (void);
// Destructor.
virtual int operator == (const CosProperty_Hash_Key &hash_key) const;
// The operator for hash binding and "find"ing.
virtual u_long hash (void) const;
// The function that computes a hash value.
// private:
CosPropertyService::PropertyName_var pname_;
// Storage pointer.
};
class TAO_Property_Export CosProperty_Hash_Value
{
// = TITLE
// This will be the value part in the Hash_Table. The INT_ID of
// the ACE_Hash_Map_Manager.
public:
// = Initialization and termination methods.
CosProperty_Hash_Value (void);
// Default constructor.
CosProperty_Hash_Value (const CORBA::Any &any,
const CosPropertyService::PropertyModeType &mode);
// Constructor with the property_value and the property_mode.
CosProperty_Hash_Value (const CosProperty_Hash_Value &hash_value);
// Copy constructor.
virtual ~CosProperty_Hash_Value (void);
// Destructor.
//private:
CORBA::Any pvalue_;
// property value.
CosPropertyService::PropertyModeType pmode_;
// Property Mode.
};
// ============================================================================
// Forward declaration.
class TAO_PropertySet;
// ============================================================================
class TAO_Property_Export TAO_PropertySetFactory : public virtual POA_CosPropertyService::PropertySetFactory
{
// = TITLE
// Factory class for the TAO_PropertySet class objects.
//
// = DESCRIPTION
// The object may be created with some predfined properties.
public:
// = Initialization and termination methods.
TAO_PropertySetFactory (void);
// Constructor.
virtual ~TAO_PropertySetFactory (void);
// Destructor.
virtual CosPropertyService::PropertySet_ptr
create_propertyset (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
// Returns a new TAO_PropertySet object. "The property set returned
// will *not* have any initial properties."
virtual CosPropertyService::PropertySet_ptr
create_constrained_propertyset (const CosPropertyService::PropertyTypes &allowed_property_types,
const CosPropertyService::Properties &allowed_properties
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosPropertyService::ConstraintNotSupported));
// Allows a client to create a new TAO_PropertySet with specific
// constraints. "All the properties will have *fixed-normal* modes".
virtual CosPropertyService::PropertySet_ptr
create_initial_propertyset (const CosPropertyService::Properties &initial_properties
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosPropertyService::MultipleExceptions));
// Allows a client to create a new TAO_PropertySet with specific
// initial properties."All the properties will have *fixed-normal"
// modes".
private:
TAO_Unbounded_Sequence<TAO_PropertySet*> propertyset_products_;
// The PropertySet objects new'ed and given to the client. Let us
// keep track all of them so that we can delete them at the end.
};
// ============================================================================
// Forward declaration.
class TAO_PropertySetDef;
// ============================================================================
class TAO_Property_Export TAO_PropertySetDefFactory : public virtual POA_CosPropertyService::PropertySetDefFactory
{
// = TITLE
// Factory class for the TAO_PropertySetDef objects.
//
// = DESCRIPTION
// The object creation may be done with some predefined properties.
public:
// = Initialization and termination methods.
TAO_PropertySetDefFactory(void);
// Constructor.
virtual ~TAO_PropertySetDefFactory (void);
// Destructor.
virtual CosPropertyService::PropertySetDef_ptr
create_propertysetdef (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
// Returns a new TAO_PropertySetDef object.
virtual CosPropertyService::PropertySetDef_ptr
create_constrained_propertysetdef (const CosPropertyService::PropertyTypes &allowed_property_types,
const CosPropertyService::PropertyDefs &allowed_property_defs
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosPropertyService::ConstraintNotSupported));
// Allows a client to create a new TAO_PropertySetDef with specific
// constraints.
virtual CosPropertyService::PropertySetDef_ptr
create_initial_propertysetdef (const CosPropertyService::PropertyDefs &initial_property_defs
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosPropertyService::MultipleExceptions));
// Allows a client to create a new TAO_PropertySetDef with specific
// initial properties.
private:
TAO_Unbounded_Sequence<TAO_PropertySetDef*> propertysetdef_products_;
// The PropertySet objects new'ed and given to the client. Let us
// keep track all of them so that we can delete them at the end.
};
// ============================================================================
class TAO_Property_Export TAO_PropertySet : public virtual POA_CosPropertyService::PropertySet
{
// = TITLE
// Gives operations for defining, deleting, enumerating and
// checking of properties.
//
// = DESCRIPTION
// Uses a HashTable to manage the properties.
public:
friend class TAO_PropertyNamesIterator;
friend class TAO_PropertiesIterator;
// = Initialization and termination methods.
TAO_PropertySet (void);
// Default constructor.
TAO_PropertySet (const CosPropertyService::PropertyTypes allowed_property_types,
const CosPropertyService::Properties allowed_properties
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
// Init values that the PropertySetFactory will want to specify.
TAO_PropertySet (const CosPropertyService::Properties initial_properties
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
// PropertySetFactory needs this constructor.
TAO_PropertySet (const CosPropertyService::PropertyTypes allowed_property_types,
const CORBA::ULong number_of_allowed_propertydefs
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
// PropertySetDef's construction needs this.
virtual ~TAO_PropertySet (void);
// Destructor function.
virtual void define_property (const char *property_name,
const CORBA::Any &property_value
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosPropertyService::InvalidPropertyName,
CosPropertyService::ConflictingProperty,
CosPropertyService::UnsupportedTypeCode,
CosPropertyService::UnsupportedProperty,
CosPropertyService::ReadOnlyProperty));
// Store the property in the hash after checking for validity of the
// property name, duplicate name, type code over writing etc.
virtual void define_properties (const CosPropertyService::Properties &nproperties
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosPropertyService::MultipleExceptions));
// Define a sequence of properties at a time.
virtual CORBA::ULong get_number_of_properties (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
// Get the number of properties that are currently defined in the
// PropertySet.
virtual void get_all_property_names (CORBA::ULong how_many,
CosPropertyService::PropertyNames_out property_names,
CosPropertyService::PropertyNamesIterator_out rest
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
// Get the names of all the properties that are currently defined in
// the property set.
virtual CORBA::Any *get_property_value (const char *property_name
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosPropertyService::PropertyNotFound,
CosPropertyService::InvalidPropertyName));
// Get the value of the property, given the name.
virtual CORBA::Boolean get_properties (const CosPropertyService::PropertyNames &property_names,
CosPropertyService::Properties_out nproperties
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
// Get all names and their property values.
virtual void get_all_properties (CORBA::ULong how_many,
CosPropertyService::Properties_out nproperties,
CosPropertyService::PropertiesIterator_out rest
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
// Returns all of the property names currently defined in the
// PropertySet. If the PropertySet contains more than how_many
// property names, then the remaining property names are put into the PropertyNamesIterator.
virtual void delete_property (const char *property_name
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosPropertyService::PropertyNotFound,
CosPropertyService::InvalidPropertyName,
CosPropertyService::FixedProperty));
// Delete a property given a name.
virtual void delete_properties (const CosPropertyService::PropertyNames &property_names
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -