PG_Property_Set_Find.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    PG_Property_Set_Find.h
00006  *
00007  *  PG_Property_Set_Find.h,v 1.5 2006/03/14 06:14:34 jtc Exp
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 
00026 #include "ace/Hash_Map_Manager.h"
00027 
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029 
00030 namespace TAO
00031 {
00032   /**
00033    * Find a value in a TAO::PG_Property_Set.
00034    * This is a work-around for the lack of
00035    * templated methods.
00036    */
00037   template <typename TYPE>
00038   int find (const PG_Property_Set & decoder, const ACE_CString & key, TYPE & value)
00039   {
00040     int result = 0;
00041     PortableGroup::Value const * any;
00042     if ( decoder.find (key, any))
00043     {
00044       result = ((*any) >>= value);
00045     }
00046     return result;
00047   }
00048 
00049 } //namespace TAO
00050 
00051 TAO_END_VERSIONED_NAMESPACE_DECL
00052 
00053 #include /**/ "ace/post.h"
00054 
00055 #endif // TAO_PG_PROPERTY_SET_FIND_H

Generated on Thu Nov 9 14:03:34 2006 for TAO_PortableGroup by doxygen 1.3.6