Interpreter_Utils_T.cpp File Reference

#include "orbsvcs/Trader/Interpreter_Utils_T.h"
#include "orbsvcs/Trader/Constraint_Visitors.h"
#include "tao/DynamicAny/DynSequence_i.h"

Include dependency graph for Interpreter_Utils_T.cpp:

Go to the source code of this file.

Functions

template<class OPERAND_TYPE>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
CORBA::Boolean 
TAO_find (const CORBA::Any &sequence, const OPERAND_TYPE &element)


Function Documentation

template<class OPERAND_TYPE>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA::Boolean TAO_find ( const CORBA::Any &  sequence,
const OPERAND_TYPE &  element 
)

Definition at line 13 of file Interpreter_Utils_T.cpp.

Referenced by TAO_Constraint_Evaluator::sequence_does_contain().

00014 {
00015   CORBA::Boolean return_value = 0;
00016   TAO_Element_Equal<OPERAND_TYPE> functor;
00017   TAO_DynSequence_i dyn_seq;
00018 
00019   try
00020     {
00021       dyn_seq.init (sequence);
00022 
00023       CORBA::ULong length =
00024         dyn_seq.get_length ( );
00025 
00026       dyn_seq.rewind( );
00027 
00028       for (CORBA::ULong i = 0 ; i < length && ! return_value; i++)
00029         {
00030           if (functor (dyn_seq, element))
00031             return_value = 1;
00032 
00033           dyn_seq.next( );
00034         }
00035     }
00036   catch (const CORBA::Exception&)
00037     {
00038       return 0;
00039     }
00040 
00041   return return_value;
00042 }


Generated on Tue Feb 2 17:49:28 2010 for TAO_CosTrader by  doxygen 1.4.7