00001 // Property_Boolean.cpp,v 1.7 2006/03/14 06:14:34 jtc Exp 00002 00003 #include "orbsvcs/Notify/Property_Boolean.h" 00004 00005 #if ! defined (__ACE_INLINE__) 00006 #include "orbsvcs/Notify/Property_Boolean.inl" 00007 #endif /* __ACE_INLINE__ */ 00008 00009 ACE_RCSID(Notify, TAO_Notify_Property_Boolean, "Property_Boolean.cpp,v 1.7 2006/03/14 06:14:34 jtc Exp") 00010 00011 #include "orbsvcs/Notify/PropertySeq.h" 00012 00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00014 00015 TAO_Notify_Property_Boolean::TAO_Notify_Property_Boolean (const char* name) 00016 : name_ (name), valid_(0) 00017 { 00018 } 00019 00020 TAO_Notify_Property_Boolean::TAO_Notify_Property_Boolean (const char* name, CORBA::Boolean initial) 00021 :name_ (name), value_ (initial), valid_ (1) 00022 { 00023 } 00024 00025 int 00026 TAO_Notify_Property_Boolean::set (const TAO_Notify_PropertySeq& property_seq) 00027 { 00028 CosNotification::PropertyValue value; 00029 00030 if (property_seq.find (this->name_, value) == -1) 00031 return -1; 00032 00033 value >>= CORBA::Any::to_boolean (this->value_); 00034 00035 return 0; 00036 } 00037 00038 void 00039 TAO_Notify_Property_Boolean::get (CosNotification::PropertySeq& prop_seq) 00040 { 00041 /// Make space 00042 prop_seq.length (prop_seq.length () + 1); 00043 00044 prop_seq[prop_seq.length () - 1].value <<= CORBA::Any::from_boolean (this->value_); 00045 } 00046 00047 TAO_END_VERSIONED_NAMESPACE_DECL