Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / OBV / Indirection / Factory.cpp
blob5dd645d342d1aac8928b3bf3744a5ee17abc7f8c
1 #include "Factory.h"
2 #include "tao/AnyTypeCode/TypeCode.h"
4 void
5 NodeFactory::register_new_factory (CORBA::ORB& orb) {
6 CORBA::ValueFactoryBase_var mf = new NodeFactory;
7 CORBA::String_var id = ::demo::value::idl::_tc_Node->id ();
8 orb.register_value_factory (id.in (), mf.in ());
11 CORBA::ValueBase*
12 NodeFactory::create_for_unmarshal ()
14 ::CORBA::ValueBase *ret_val = 0;
15 ACE_NEW_THROW_EX (
16 ret_val,
17 OBV_demo::value::idl::Node,
18 ::CORBA::NO_MEMORY ());
19 return ret_val;
22 void
23 BoxedValueFactory::register_new_factory (CORBA::ORB& orb) {
24 CORBA::ValueFactoryBase_var mf = new BoxedValueFactory;
25 demo::value::idl::boxedValue_var bv (new OBV_demo::value::idl::boxedValue);
26 CORBA::String_var id = bv->_tao_type ()->id ();
27 orb.register_value_factory (id.in (), mf.in ());
30 CORBA::ValueBase*
31 BoxedValueFactory::create_for_unmarshal ()
33 ::CORBA::ValueBase *ret_val = 0;
34 ACE_NEW_THROW_EX (
35 ret_val,
36 OBV_demo::value::idl::boxedValue,
37 ::CORBA::NO_MEMORY ());
38 return ret_val;
41 void
42 BaseValueFactory::register_new_factory (CORBA::ORB& orb) {
43 CORBA::ValueFactoryBase_var mf = new BaseValueFactory;
44 demo::value::idl::BaseValue_var bv (new OBV_demo::value::idl::BaseValue);
45 CORBA::String_var id = bv->_tao_type ()->id ();
46 orb.register_value_factory (id.in (), mf.in ());
49 CORBA::ValueBase*
50 BaseValueFactory::create_for_unmarshal ()
52 ::CORBA::ValueBase *ret_val = 0;
53 ACE_NEW_THROW_EX (
54 ret_val,
55 OBV_demo::value::idl::BaseValue,
56 ::CORBA::NO_MEMORY ());
57 return ret_val;
60 void
61 TValueFactory::register_new_factory (CORBA::ORB& orb) {
62 CORBA::ValueFactoryBase_var mf = new TValueFactory;
63 demo::value::idl::TValue_var bv (new OBV_demo::value::idl::TValue);
64 CORBA::String_var id = bv->_tao_type ()->id ();
65 orb.register_value_factory (id.in (), mf.in ());
68 CORBA::ValueBase*
69 TValueFactory::create_for_unmarshal ()
71 ::CORBA::ValueBase *ret_val = 0;
72 ACE_NEW_THROW_EX (
73 ret_val,
74 OBV_demo::value::idl::TValue,
75 ::CORBA::NO_MEMORY ());
76 return ret_val;
79 void
80 ConfigValueFactory::register_new_factory (CORBA::ORB& orb) {
81 CORBA::ValueFactoryBase_var mf = new ConfigValueFactory;
82 demo::value::idl::ConfigValue_var bv (new OBV_demo::value::idl::ConfigValue);
83 CORBA::String_var id = bv->_tao_type ()->id ();
84 orb.register_value_factory (id.in (), mf.in ());
87 CORBA::ValueBase*
88 ConfigValueFactory::create_for_unmarshal ()
90 ::CORBA::ValueBase *ret_val = 0;
91 ACE_NEW_THROW_EX (
92 ret_val,
93 OBV_demo::value::idl::ConfigValue,
94 ::CORBA::NO_MEMORY ());
95 return ret_val;
98 ConfigValueImpl::ConfigValueImpl (const char* name, const char* value)
100 this->name (name);
101 this->value () <<= value;