WindowsRTX64UsingSTL
Description
This sample demonstrates data exchange between a real-time process and a Windows user-space process using C++ STL classes to manage the data that is exchanged via a shared memory region. There are three folders in this sample:
- Common — this folder contains common code referenced by the projects in the other two folders.
- RtConsumer — this folder contains a project and source code to build a real-time process that consumes data produced by a Windows user-space application, modifies it, and sends it back to the Windows application.
- WinProducer — this folder contains a project and source code to build a Windows user-space application that produces data to be consumed by a real-time application. This application also displays the data after it has been modified by the real-time application.
Source Files
Common/common.h
– Defines common types and macros used throughout the sample.Common/DataOwner.cpp
– Implementation of class DataOwner, which manages a shared memory region used to transfer data between the real-time process and the Windows process.Common/DataOwner.h
– Public interface of class DataOwner.RtConsumer/RtConsumer/RealtimeConsumer.cpp
– Part of a real-time application. This file implements class RealtimeConsumer, which waits on an event and when that event is signaled by the WinProducer application, consumes the data.RtConsumer/RtConsumer/RealtimeConsumer.h
– Public interface definition for class RealtimeConsumer.RtConsumer/RtConsumer/RtConsumer.cpp
– A real-time application that instantiates class RealtimeConsumer and operates that instance.RtConsumer/RtConsumer/RtConsumer.h
– Template-generated header file for project RtConsumer.RtConsumer/RtConsumer/RtConsumer_VS2012.vcxproj
– Visual Studio 2012 project file for project RtConsumer.RtConsumer/RtConsumer/RtConsumer_VS2012.vcxproj.filters
– Visual Studio 2012 filters file for project RtConsumer.RtConsumer/RtConsumer_VS2012.sln
– The solution file for the RtConsumer project.WinProducer/WinProducer/WinProducer.cpp
– A windows application that sends data and commands to the real-time consumer application using shared memory and an event.WinProducer/WinProducer/WinProducer.h
– Template-generate header file for project WinProducer.WinProducer/WinProducer/WinProducer_VS2012.vcxproj
– VS2012 project file for project WinProducer.WinProducer/WinProducer/WinProducer_VS2012.vcxproj.filters
– VS2012 filters file for project WinProducer.WinProducer/WinProducer_VS2012.sln
– The solution file for the WinProducer project.
Building the Sample
Open the solution in Visual Studio and build the RtConsumer and WinProducer projects as they are.
Running the Sample
Start the RtConsumer real-time application first, then start the WinProducer application.
APIs Referenced
RTAPI |