Exemplo n.º 1
0
void appendInteraction(
         Interactions*   interactions,
         ChannelID       chid,
         bool            is_native,
         const char*     name,
         SpecificationID specID,
         Object*         data,
         TimeInterval    interval
                      )
{
InteractionChannel* channel;
Interaction* interaction;

  assertion( chid >= -1, "pre appendInteraction: chid should be correct" );

  channel = NULL;
  if (chid != UniqueChannel)
    channel = getChannelByID(interactions,chid);
  if (channel == NULL)
   {channel = createInteractionChannel(chid);
    if (interactions->first == NULL)
      interactions->first = channel;
    else
      interactions->last->nextPtr = channel;
    interactions->last  = channel;
   }
  // create interaction
  interaction = createInteraction( interactions->numInteractions, is_native, name, specID, data, interval );
  if (is_native)
    traceModelOperationIdentifier(interaction->id);
  // physical appending of interaction
  appendInteractionToChannel( interactions, channel, interaction );
  interactions->numInteractions++;
}
Exemplo n.º 2
0
 /// constructor that parses an interaction string and adopts the
 /// specified settings.
 DistanceInteractor(const ::std::string actions) {
   uint pos=0;
   ::std::string action;
   Interaction* interact;
   DBG(10) << VAR(actions) << ::std::endl;
   while(pos<actions.size()) {
     uint spos=actions.find("ACTION=",pos);
     uint epos=actions.find(":",pos+1);
     DBG(25) << VAR(spos) << VAR(epos) << VAR(pos) << ::std::endl;
     if (spos<actions.size()) {
       if(epos >= actions.size()) {epos=actions.size();}
       action.assign(actions,spos+7,epos-spos);
       DBG(10) << VAR(action) << ::std::endl;
       interact=createInteraction(action);
       interactions_.push_back(interact);
       pos=epos;
     }
   }
 }