// {{{RME classifier 'Logical View::Operador'

#if defined( PRAGMA ) && ! defined( PRAGMA_IMPLEMENTED )
#pragma implementation "Operador.h"
#endif

#include <RTSystem/SolicitarPacotesComponent.h>
#include <Operador.h>

// {{{RME classifier 'Logical View::Operador' tool 'OT::Cpp' property 'ImplementationPreface'
// {{{USR tool 'OT::Cpp' property 'ImplementationPreface'
// }}}USR
// }}}RME

static const RTRelayDescriptor rtg_relays[] =
{
	{
		"planejamento_comm"
	  , &CommSolicitaPacote::Base::rt_class
	  , 1 // cardinality
	}
};

static RTActor * new_Operador_Actor( RTController * _rts, RTActorRef * _ref )
{
	return new Operador_Actor( _rts, _ref );
}

const RTActorClass Operador =
{
	(const RTActorClass *)0
  , "Operador"
  , (RTVersionId)0
  , 1
  , rtg_relays
  , new_Operador_Actor
};

static const char * const rtg_state_names[] =
{
	"TOP"
};

#define SUPER RTActor

Operador_Actor::Operador_Actor( RTController * rtg_rts, RTActorRef * rtg_ref )
	: RTActor( rtg_rts, rtg_ref )
{
}

Operador_Actor::~Operador_Actor( void )
{
}

// {{{RME classifier 'Logical View::Operador' operation 'SolPacotes()'
void Operador_Actor::SolPacotes( void )
{
	// {{{USR operation 'SolPacotes()'
	// }}}USR
}
// }}}RME

// {{{RME classifier 'Logical View::Operador' operation 'CancelaMissao()'
void Operador_Actor::CancelaMissao( void )
{
	// {{{USR operation 'CancelaMissao()'
	// }}}USR
}
// }}}RME

int Operador_Actor::_followInV( RTBindingEnd & rtg_end, int rtg_portId, int rtg_repIndex )
{
	switch( rtg_portId )
	{
	case 0:
		// planejamento_comm
		if( rtg_repIndex < 1 )
		{
			rtg_end.port = &planejamento_comm;
			rtg_end.index = rtg_repIndex;
			return 1;
		}
		break;
	default:
		break;
	}
	return RTActor::_followInV( rtg_end, rtg_portId, rtg_repIndex );
}

void Operador_Actor::rtsBehavior( int signalIndex, int portIndex )
{
	for( int stateIndex = getCurrentState(); ; stateIndex = rtg_parent_state[ stateIndex - 1 ] )
		switch( stateIndex )
		{
		case 1:
			// {{{RME classifier 'Logical View::Operador' state ':TOP'
			switch( portIndex )
			{
			case 0:
				switch( signalIndex )
				{
				case 1:
					return;
				default:
					break;
				}
				break;
			default:
				break;
			}
			unexpectedMessage();
			return;
			// }}}RME
		default:
			unexpectedState();
			return;
		}
}

const RTActor_class * Operador_Actor::getActorData( void ) const
{
	return &Operador_Actor::rtg_class;
}

const RTActor_class Operador_Actor::rtg_class =
{
	(const RTActor_class *)0
  , rtg_state_names
  , 1
  , Operador_Actor::rtg_parent_state
  , &Operador
  , 0
  , (const RTComponentDescriptor *)0
  , 1
  , Operador_Actor::rtg_ports
  , 0
  , (const RTLocalBindingDescriptor *)0
  , 2
  , Operador_Actor::rtg_Operador_fields
};

const RTStateId Operador_Actor::rtg_parent_state[] =
{
	0
};

const RTPortDescriptor Operador_Actor::rtg_ports[] =
{
	{
		"planejamento_comm"
	  , (const char *)0
	  , &CommSolicitaPacote::Base::rt_class
	  , RTOffsetOf( Operador_Actor, Operador_Actor::planejamento_comm )
	  , 1 // cardinality
	  , 1
	  , RTPortDescriptor::End
	  , RTPortDescriptor::NotificationDisabled
	  , RTPortDescriptor::RegisterNotPermitted
	  , RTPortDescriptor::PublicVisibility
	  , RTPortDescriptor::Wired
	}
};

const RTFieldDescriptor Operador_Actor::rtg_Operador_fields[] =
{
	// {{{RME classifier 'Logical View::Operador' classAttribute 'Missao'
	{
		"Missao"
	  , RTOffsetOf( Operador_Actor, Missao )
		// {{{RME classifier 'Logical View::Operador' classAttribute 'Missao' tool 'OT::CppTargetRTS' property 'TypeDescriptor'
	  , &RTType_long
		// }}}RME
		// {{{RME classifier 'Logical View::Operador' classAttribute 'Missao' tool 'OT::CppTargetRTS' property 'GenerateTypeModifier'
	  , (const RTTypeModifier *)0
		// }}}RME
	}
	// }}}RME
	// {{{RME classifier 'Logical View::Operador' classAttribute 'PctID'
  , {
		"PctID"
	  , RTOffsetOf( Operador_Actor, PctID )
		// {{{RME classifier 'Logical View::Operador' classAttribute 'PctID' tool 'OT::CppTargetRTS' property 'TypeDescriptor'
	  , &RTType_long
		// }}}RME
		// {{{RME classifier 'Logical View::Operador' classAttribute 'PctID' tool 'OT::CppTargetRTS' property 'GenerateTypeModifier'
	  , (const RTTypeModifier *)0
		// }}}RME
	}
	// }}}RME
};
#undef SUPER

// {{{RME classifier 'Logical View::Operador' tool 'OT::Cpp' property 'ImplementationEnding'
// {{{USR tool 'OT::Cpp' property 'ImplementationEnding'
// }}}USR
// }}}RME

// }}}RME
