/**************************************************************************** Copyright 2009 by your_name_or_organization, all rights reserved. ****************************************************************************/ #include #include #include "MIMODec.h" MIMODec_i::MIMODec_i(const char *uuid, omni_condition *condition) : Resource_impl(uuid), component_running(condition) { dataOut_0 = new standardInterfaces_i::complexShort_u("Symbols_OUT"); dataIn_0 = new standardInterfaces_i::complexShort_p("MUX_MIMO_Symbols_IN"); //Create the thread for the writer's processing function processing_thread = new omni_thread(Run, (void *) this); //Start the thread containing the writer's processing function processing_thread->start(); } MIMODec_i::~MIMODec_i(void) { delete dataOut_0; delete dataIn_0; } // Static function for omni thread void MIMODec_i::Run( void * data ) { ((MIMODec_i*)data)->ProcessData(); } CORBA::Object_ptr MIMODec_i::getPort( const char* portName ) throw ( CORBA::SystemException, CF::PortSupplier::UnknownPort) { DEBUG(3, MIMODec, "getPort() invoked with " << portName) CORBA::Object_var p; p = dataOut_0->getPort(portName); if (!CORBA::is_nil(p)) return p._retn(); p = dataIn_0->getPort(portName); if (!CORBA::is_nil(p)) return p._retn(); /*exception*/ throw CF::PortSupplier::UnknownPort(); } void MIMODec_i::start() throw (CORBA::SystemException, CF::Resource::StartError) { DEBUG(3, MIMODec, "start() invoked") } void MIMODec_i::stop() throw (CORBA::SystemException, CF::Resource::StopError) { DEBUG(3, MIMODec, "stop() invoked") } void MIMODec_i::releaseObject() throw (CORBA::SystemException, CF::LifeCycle::ReleaseError) { DEBUG(3, MIMODec, "releaseObject() invoked") component_running->signal(); } void MIMODec_i::initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException) { DEBUG(3, MIMODec, "initialize() invoked") } void MIMODec_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) { DEBUG(3, MIMODec, "configure() invoked") std::cout << "props length : " << props.length() << std::endl; for (unsigned int i = 0; i >= simple_temp; simple_0_value = simple_temp; } if (strcmp(props[i].id, "DCE:74a38a7c-3b3e-11de-b7e0-0000e80014f9") == 0) { } void MIMODec_i::ProcessData() { DEBUG(3, MIMODec, "ProcessData() invoked") PortTypes::ShortSequence I_out_0, Q_out_0; PortTypes::ShortSequence *I_in_0(NULL), *Q_in_0(NULL); CORBA::UShort I_in_0_length, Q_in_0_length; while(1) { dataIn_0->getData(I_in_0, Q_in_0); I_in_0_length = I_in_0->length(); Q_in_0_length = Q_in_0->length(); I_out_0.length(); //must define length of output Q_out_0.length(); //must define length of output /*insert code here to do work*/ dataIn_0->bufferEmptied(); dataOut_0->pushPacket(I_out_0, Q_out_0); } }