diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h new file mode 100644 index 00000000000..b06794df571 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h @@ -0,0 +1,50 @@ +/* -*- C++ -*- */ +//============================================================================= +/** + * @file PG_Property_Set_Find.h + * + * $Id$ + * + * This is a companion function for the properties docoder + * to work around compilers that don't support templated methods. + * + * @author Dale Wilson <wilson_d@ociweb.com> + */ +//============================================================================= +#ifndef TAO_PG_PROPERTY_SET_FIND_H +#define TAO_PG_PROPERTY_SET_FIND_H +#include /**/ "ace/pre.h" +#include <ace/ACE.h> + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "portablegroup_export.h" + +#include "ace/Hash_Map_Manager.h" + +namespace TAO +{ + /** + * Find a value in a TAO::PG_Property_Set. + * This is a work-around for the lack of + * templated methods. + */ + template <typename TYPE> + int find (const PG_Property_Set & decoder, const ACE_CString & key, TYPE & value) + { + int result = 0; + PortableGroup::Value const * any; + if ( decoder.find (key, any)) + { + result = ((*any) >>= value); + } + return result; + } + +} //namespace TAO + +#include /**/ "ace/post.h" + +#endif // TAO_PG_PROPERTY_SET_FIND_H |