Articles Forum Examples Download Open Source
Copyright(c) 2006 by Pocomatic Software. All rights reserved.
This example illustrates a Software Defined Radio (SDR) waveform application assembled using PocoCapsule/C++. The original example can be found in the CRC's reference implementation of the JTRS-SCA.
Note: A JTRS-SCA compliant CORBA based version of this example can be found in the ${POCOCAPSULE_DIR}/examples/corba/jtrs-sca directory. However, The non-CORBA version of the same SDR waveform application presented here is more straightforward and significantly slim than its CORBA counterpart. Therefore, when all components of a waveform application are inside a same addressing space, this non-CORBA approach is a much better alternative.
The modeled SDR waveform application consists of the following eight components:
An AudioDevice: the node1-audio-device bean
An AudioEchoResource: the echo-resource bean
An AudioChorusResource: the chorus-resource bean
An AudioEffectController: the audio-effect-controller bean
A ModulationFMResource: the modulation-FM-resource bean
A DemodulationFMResource: the demodulation-FM-resource bean
A FMTransmitterReceiverAssemblyController: the FM-transmitter-receiver-assembly-controller bean
A LogImpl: the log bean
These components are implemented as plain old C++ objects (POCOs) and are instantiated and wired up using the PocoCapsule/C++ IoC Container according to the setup.xml description. The assembled SDR waveform application is illustrated in the following diagram:

main.C: This is a mini container, used by PocoCapsule/C++ to assemble/deploy this SDR waveform. This container is completely application logic independent. It contains no application specific code. Its executable, after build, does not depend on (by linking to) any application specific component modules (dynamic libraries).
AudioEffect.h and AudioEffect.C: "Business logic" implementations of the following components in plain old C++ object classes:
AudioDevice,
AudioEchoResource
AudioChorusResource.
AudioEffectController
These application logic implementations are completely framework (i.e. PocoCapsule/C++) independent. They contain no PocoCapsule/C++ specific code. It binary module (dynamic library), after build, does not depend on (by linking to) PocoCapsule/C++ runtime either.
FMTransmitterReciver.h and FMTransmitterReciver.C: These files provides application logic implementations of the following components in plain old C++ object classes:
DemodulationFMResource
ModulationFMResource
FMTransmitterReceiverAssemblyController
These application logic implementations are completely framework (i.e. PocoCapsule/C++) independent (a.k.a container agnostic). They contain no PocoCapsule/C++ specific code. It binary module (dynamic library), after build, does not depend on (by linking to) PocoCapsule/C++ runtime either.
sampleImpl.h: provides simple (inline) implementation of all push-in ports (support SDR::PushPort) and the log (support SDR::Log).
sdr.h: provides interface defintions of SDR::PushPort, SDR::Controllable and SDR:Log.
setup.xml: This is the application context described the setup of this SDR model application.
To build this example, the environment variable POCOCAPSULE_DIR should point to the PocoCapsule/C++ installed directory. Then, this example can be built by simply invoking gmake/make on linux/unix or nmake on windows.
· Before starting the application deployment container (i.e. the main executable), make sure the LD_LIBRARY_PATH (on linux and solaris) or the PATH (on windows) environment variable is set correctly to include the ${POCOCAPSULE_DIR}/lib directory.
· start the main executable:
prompt> main
It will display the following component instantiation and wiring operations made during the assembling:
[init]: The audio effect controller component is instantiated [init]: The node1 audio device component is instantiated [init]: The AudioIn push-in port of node1 audio device is instantiated [init]: The AudioInRightDouble push-in port of the node1 audio device is instantiated [init]: The AudioInLeftDouble push-in port of the node1 audio device is instantiated [init]: The echo resource component is instantiated [init]: The AudioIn push-in port of the echo resource is instantiated [init]: The chorus resource component is instantiated [init]: The AudioIn push-in port of the chorus resource is instantiated [wire]: The AudioIn push-in port of node1 audio device is connected to the AudioOut port of the chorus resource [wire]: The log service is connected the logPort of the chorus resource [wire]: The AudioIn push-in port of the chorus resource is connected to the AudioOut port of the echo resource [wire]: The log service is connected the logPort of the echo resource [wire]: The AudioIn push-in port of the echo resource is connected to the AudioOut port of the node1 audio device [init]: The demodulation FM resource component is instantiated [init]: The DoubleSeqIn push-in port of demodulation FM resource is instantiated [wire]: The AudioInRightDouble port of the node1 audio device is connected to the DoubleSeqOut port of the demodulation FM resource [wire]: The log service is connected to the logPort of the demodulation FM resource [wire]: The DoubleSeqIn push-in port of demodulation FM resource is subscribed to the AudioOutLeftDouble port of the node1 audio device [init]: The modulation FM resource component is instantiated [init]: The DoubleSeqIn push-in port of modulation FM resource is instantiated [wire]: The AudioInLeftDouble push-in port of the node1 audio device is connected to the DoubleSeqOut port of the modulation FM resource [wire]: The log service is connected to the logPort of the modulation FM resource [wire]: The DoubleSeqIn push-in port of modulation FM resource is subscribed to the AudioOutLeftDouble port of the node1 audio device [wire]: The log service is connected to the logPort of the node1 audio device [wire]: The node1 audio device is connected to the AudioInControl port of the audio effect controller [wire]: The node1 audio device is connected to the AudioOutControl port of the audio effect controller [wire]: The echo resource is connected to the AudioEchoControl port of the audio effect controller [wire]: The chorus resource is connected to the AudioChorusControl port of the audio effect controller [wire]: The log service is connected to the logPort of the audio effect controller [init]: The FM transmitter/receiver assembly controller component is instantiated [wire]: The modulation FM resource is connected to the ModulationFMControl port of the FM transmitter/receiver assembly controller [wire]: The demodulation FM resource is connected to the DemodulationFMControl port of the FM transmitter/receiver assembly controller [wire]: The node1 audio device is connected to the OutputDeviceControl port of the FM transmitter/receiver assembly controller [wire]: The node1 audio device is connected to the InputDeviceControl port of the FM transmitter/receiver assembly controller [wire]: The log service is connected to the logPort of the FM transmitter/receiver assembly controller
It shows 8 components/service, 7 push-in ports are instantiated, and 22 dependencies are wired.