2 #ifndef NAMING_CONTEXT_H
3 #define NAMING_CONTEXT_H
5 #include "ace/Naming_Context.h"
6 #include "ace/OS_NS_stdio.h"
7 #include "Name_Binding.h"
10 class Naming_Context
: public ACE_Naming_Context
13 typedef ACE_Naming_Context inherited
;
15 int rebind (const char *name_in
,
17 const char *type_in
= "")
19 return this->inherited::rebind (name_in
, value_in
, type_in
);
22 int rebind (const char *name_in
,
24 const char *type_in
= "")
27 ACE_OS::sprintf (buf
, "%2f", value_in
);
28 return this->inherited::rebind (name_in
,
33 int rebind (const char *name_in
,
35 const char *type_in
= "")
38 ACE_OS::sprintf (buf
, "%d", value_in
);
39 return this->inherited::rebind (name_in
,
45 // Listing 2 code/ch21
46 Name_Binding
*fetch (const char *name
)
51 if (this->resolve (name
, value
, type
) != 0 ||
58 new Name_Binding (ACE_NS_WString (name
),
68 #endif /* NAMING_CONTEXT_H */