Version: 8.3.0
YACS::ENGINE::isAdaptableObjref< IMPLIN, IMPLOUT > Struct Template Reference

Static Public Member Functions

static int apply (const TypeCode *t1, const TypeCode *t2)
 

Detailed Description

template<ImplType IMPLIN, ImplType IMPLOUT>
struct YACS::ENGINE::isAdaptableObjref< IMPLIN, IMPLOUT >

Definition at line 250 of file TypeConversions.cxx.

Member Function Documentation

template<ImplType IMPLIN, ImplType IMPLOUT>
static int YACS::ENGINE::isAdaptableObjref< IMPLIN, IMPLOUT >::apply ( const TypeCode t1,
const TypeCode t2 
)
inlinestatic

Definition at line 252 of file TypeConversions.cxx.

References YACS::ENGINE::TypeCodeSeq::contentType(), YACS::ENGINE::TypeCode::id(), YACS::ENGINE::TypeCode::isA(), YACS::ENGINE::TypeCode::kind(), YACS::ENGINE::Objref, and YACS::ENGINE::Sequence.

253  {
254  if(t1->kind() == Objref)
255  {
256  //The inport type must be more general than outport type
257  if( t1->isA(t2->id()) )
258  return 1;
259  }
260  else if(t1->kind() == Sequence)
261  {
262  const TypeCodeSeq *t1c(dynamic_cast<const TypeCodeSeq *>(t1));
263  if(!t1c)
264  return 0;
265  const TypeCode *t1cc(t1c->contentType());
266  if(t1cc==t2)
267  return 1;
268  if(t1cc->kind() == Objref && std::string(t1cc->id())==std::string(t2->id()))
269  return 1;
270  }
271  return 0;
272  }

The documentation for this struct was generated from the following file: