summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-02-17 03:52:04 +0000
committeralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-02-17 03:52:04 +0000
commitc7dd5a2c719d7ce5cad36dbd1f74b3b4c13d622a (patch)
treeeea12c4cc758b1eb14ec32f27dccb8c3a2661b94
parentbfcb1cbeb920eb6962c927db487c8f08ef15ab3c (diff)
downloadATCD-c7dd5a2c719d7ce5cad36dbd1f74b3b4c13d622a.tar.gz
*** empty log message ***
-rw-r--r--TAO/orbsvcs/orbsvcs/CosPropertyService_i.cpp5
-rw-r--r--TAO/orbsvcs/tests/CosPropertyService/main.cpp106
2 files changed, 65 insertions, 46 deletions
diff --git a/TAO/orbsvcs/orbsvcs/CosPropertyService_i.cpp b/TAO/orbsvcs/orbsvcs/CosPropertyService_i.cpp
index 545c7542596..f0a5aa842ac 100644
--- a/TAO/orbsvcs/orbsvcs/CosPropertyService_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/CosPropertyService_i.cpp
@@ -159,6 +159,8 @@ TAO_PropertySet::get_property_value (const char *property_name, CORBA::Environm
{
ACE_ERROR ((LM_ERROR, "Find failed: \n"));
}
+ ACE_DEBUG ( (LM_DEBUG, "find fn over \n") );
+
return (&int_id.pvalue_);
}
@@ -184,7 +186,8 @@ TAO_PropertySet::delete_property (const char *property_name, CORBA::Environment
{
EXT_ID ext_id ( (CosPropertyService::PropertyName) property_name);
- ACE_DEBUG ( (LM_DEBUG, "delete_property : property_name %s, ext_id.pname_.in() %s \n", property_name, ext_id.pname_.in()) );
+ ACE_DEBUG ( (LM_DEBUG, "delete_property : property_name %s, ext_id.pname_.in() %s \n", property_name,
+ ext_id.pname_.in()) );
// alex: Doing unbinding.. Not getting INT_ID back... Problem if dynamic allocation is done
if (this->hash_table_.unbind (ext_id) != 0)
diff --git a/TAO/orbsvcs/tests/CosPropertyService/main.cpp b/TAO/orbsvcs/tests/CosPropertyService/main.cpp
index df5f7ee75ce..7603f6213b6 100644
--- a/TAO/orbsvcs/tests/CosPropertyService/main.cpp
+++ b/TAO/orbsvcs/tests/CosPropertyService/main.cpp
@@ -15,9 +15,11 @@
#include "orbsvcs/CosPropertyService_i.h"
-#include "tao/corbacom.h" // to know the type codes
-#include "tao/any.h" // I am using Any type.
+#include "tao/corbacom.h"
+#include "tao/any.h"
+// Prototypes
+void printAny (CORBA::Any_var anyval);
int
main (int argc, char *argv [])
@@ -30,44 +32,53 @@ main (int argc, char *argv [])
CORBA::Any testval;
// Number of properties in the PropertyaSet
- ACE_DEBUG ( (LM_DEBUG, "Test : Number of props : %d \n", propSet.get_number_of_properties (TAO_TRY_ENV)) );
+ ACE_DEBUG ( (LM_DEBUG, "Main : Number of props : %d \n", propSet.get_number_of_properties (TAO_TRY_ENV)) );
// prepare a Short and "define" that in the PropertySet
CORBA::Short s = 3;
- testval.replace ( CORBA::_tc_short, &s, CORBA::B_FALSE, TAO_TRY_ENV);
- ACE_DEBUG ( (LM_DEBUG, "Short s = %d \n", ( *(short *)testval.value ())) );
+ testval.replace ( CORBA::_tc_short,
+ &s,
+ CORBA::B_FALSE,
+ TAO_TRY_ENV);
+ ACE_DEBUG ( (LM_DEBUG, "Main : Short s = %d \n", ( *(short *)testval.value ())) );
propSet.define_property ("short_property", testval, TAO_TRY_ENV);
// prepare a Long and "define" that in the PropertySet
CORBA::Long l = 931232;
- testval.replace (CORBA::_tc_long, &l, CORBA::B_FALSE, TAO_TRY_ENV);
- ACE_DEBUG ( (LM_DEBUG, "Long l = %d \n", (*(long *)testval.value ())) );
+ testval.replace (CORBA::_tc_long,
+ &l,
+ CORBA::B_FALSE,
+ TAO_TRY_ENV);
+ ACE_DEBUG ( (LM_DEBUG, "Main : Long l = %d \n", (*(long *)testval.value ())) );
propSet.define_property ("long_property", testval, TAO_TRY_ENV);
- // prepare a Long and "define" that in the PropertySet
- float f = 3.14;
- testval.replace (CORBA::_tc_float, &f, CORBA::B_FALSE, TAO_TRY_ENV);
+ // prepare a Float and "define" that in the PropertySet
+ CORBA::Float f = 3.14;
+ testval.replace (CORBA::_tc_float,
+ &f,
+ CORBA::B_FALSE,
+ TAO_TRY_ENV);
f = (*((float *)testval.value ()));
- ACE_DEBUG ( (LM_DEBUG, "Float f = %f \n", f));
+ ACE_DEBUG ( (LM_DEBUG, "Main : Float f = %f \n", f));
propSet.define_property ("float_property", testval, TAO_TRY_ENV);
// Let us test the number of properties now
- ACE_DEBUG ( (LM_DEBUG, "Number of props : %d \n", propSet.get_number_of_properties (TAO_TRY_ENV)) );
+ ACE_DEBUG ( (LM_DEBUG, "Main : Number of props : %d \n", propSet.get_number_of_properties (TAO_TRY_ENV)) );
// delete a few properties
propSet.delete_property ("short_property", TAO_TRY_ENV);
- ACE_DEBUG ( (LM_DEBUG, "\nshort_property deleted !!") );
// Let us test the number of properties now
- ACE_DEBUG ( (LM_DEBUG, "\n Number of props : %d \n", propSet.get_number_of_properties (TAO_TRY_ENV)) );
-
+ ACE_DEBUG ( (LM_DEBUG, "\n Main : Number of props : %d \n", propSet.get_number_of_properties (TAO_TRY_ENV)) );
// Let us try to "get" back those values
- testval = * propSet.get_property_value ("float_property", TAO_TRY_ENV);
- testval = * propSet.get_property_value ("short_property", TAO_TRY_ENV);
+ //CORBA::Any_ptr anyptr;
+ //anyptr = propSet.get_property_value ("float_property", TAO_TRY_ENV);
+ //CORBA::Any_var anyvar (anyptr);
+ //printAny (anyvar.in ());
}
TAO_CATCH (CORBA::SystemException, sysex)
{
@@ -84,32 +95,37 @@ main (int argc, char *argv [])
return 0;
}
-/*
- static TypeCode_ptr _tc_short;
- static TypeCode_ptr _tc_long;
- static TypeCode_ptr _tc_ushort;
- static TypeCode_ptr _tc_ulong;
- static TypeCode_ptr _tc_float;
- static TypeCode_ptr _tc_double;
- static TypeCode_ptr _tc_boolean;
- static TypeCode_ptr _tc_char;
- static TypeCode_ptr _tc_octet;
- static TypeCode_ptr _tc_any;
- static TypeCode_ptr _tc_TypeCode;
- static TypeCode_ptr _tc_Principal;
- static TypeCode_ptr _tc_Object;
- static TypeCode_ptr _tc_struct;
- static TypeCode_ptr _tc_union;
- static TypeCode_ptr _tc_enum;
- static TypeCode_ptr _tc_string;
- static TypeCode_ptr _tc_sequence;
- static TypeCode_ptr _tc_array;
- static TypeCode_ptr _tc_alias;
- static TypeCode_ptr _tc_except;
- static TypeCode_ptr _tc_longlong;
- static TypeCode_ptr _tc_ulonglong;
- static TypeCode_ptr _tc_longdouble;
- static TypeCode_ptr _tc_wchar;
- static TypeCode_ptr _tc_wstring;
- */
+void
+printAny (CORBA::Any_var anyval)
+{
+ /*
+ switch (anyval->type ())
+ {
+ case _tc_short :
+ ACE_DEBUG ( (LM_DEBUG, "Main : Short = %d \n", ( *(short *)anyval->value ())) );
+ break;
+
+ case _tc_long :
+ ACE_DEBUG ( (LM_DEBUG, "Main : Long = %d \n", (*(long *)anyval->value ())) );
+ break;
+
+ case _tc_float :
+ ACE_DEBUG ( (LM_DEBUG, "Main : Float = %f \n", (*(long *)anyval->value ())) );
+ break;
+
+ default:
+ ACE_DEBUG ((LM_DEBUG, "I don't know this typecode"));
+ }
+ */
+
+ if (anyval->type () == CORBA::_tc_short)
+ {
+ ACE_DEBUG ( (LM_DEBUG, "Main : Short = %d \n", ( *(short *)anyval->value ())) );
+ }
+}
+
+
+
+
+