00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file PG_Property_Set_Find.h 00006 * 00007 * $Id: PG_Property_Set_Find.h 88803 2010-02-02 11:13:27Z vzykov $ 00008 * 00009 * This is a companion function for the properties docoder 00010 * to work around compilers that don't support templated methods. 00011 * 00012 * @author Dale Wilson <wilson_d@ociweb.com> 00013 */ 00014 //============================================================================= 00015 #ifndef TAO_PG_PROPERTY_SET_FIND_H 00016 #define TAO_PG_PROPERTY_SET_FIND_H 00017 #include /**/ "ace/pre.h" 00018 #include <ace/ACE.h> 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "orbsvcs/PortableGroup/portablegroup_export.h" 00025 #include "orbsvcs/PortableGroup/PG_Property_Set.h" 00026 00027 #include "ace/Hash_Map_Manager.h" 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 namespace TAO 00032 { 00033 /** 00034 * Find a value in a TAO::PG_Property_Set. 00035 * This is a work-around for the lack of 00036 * templated methods. 00037 */ 00038 template <typename TYPE> 00039 int find (const PG_Property_Set & decoder, const ACE_CString & key, TYPE & value) 00040 { 00041 int result = 0; 00042 PortableGroup::Value const * any; 00043 if ( decoder.find (key, any)) 00044 { 00045 result = ((*any) >>= value); 00046 } 00047 return result; 00048 } 00049 00050 } //namespace TAO 00051 00052 TAO_END_VERSIONED_NAMESPACE_DECL 00053 00054 #include /**/ "ace/post.h" 00055 00056 #endif // TAO_PG_PROPERTY_SET_FIND_H