// Copyright Unpublished 2003-2013. All rights reserved under the copyright // laws by Stauder Technologies. This material may be reproduced by or for // the U.S. Government pursuant to the copyright license under the clause at // DFARS 252.227-7013. Furnished to the U.S. Government with Government // Purpose Rights as defined in DFARS 252.227-7013, and Government Rights as // defined in DFARS 252.227.7022, which take precedence over any restrictive // markings herein. // // EXPORT CONTROLLED INFORMATION // // This document contains technical information which may require an export // control license or prior program management approval for distribution to // non-U.S. entities. Violations may invoke criminal and civil penalties. /////////////////////////////////////////////////////////////////////////////// #pragma once #include "TrackCUDEventsListener.h" #include namespace JTCWDDS { class TrackEventDataReader; } namespace UnManagedC2PCC { class TrackCUDEventsController { // Enumeration specific data structures JTCWDDS::TrackEventDataReader* m_TrackEventDataReader; DDSDomainParticipant* m_DDSParticipant; DDSTopic* m_TrackEventTopic; DDSDataReader* m_TrackEventReader; DDSSubscriber* m_DDSSubscriber; std::string m_UserId; std::string m_Password; int m_domainId; // If Initialization or Start request are unseccessfull, do not permit sending next request bool m_bInitializedSuccessfully; bool m_bStartedSuccessfully; // The event below is used during waiting for response from the Gateway in the // on_data_available() callback. The alternative implementation of using the WaitSets() // is similar but somehow was not working stably, creating false events. // ManualResetEvent^ m_eventEnumerationResponse; // ManualResetEvent^ m_eventGetTrackResponse; //Listener class TrackCUDEventsListener* m_TrackCUDEventsListener; public: TrackCUDEventsController(); /// /// The method Init() initializes enumeration process related DDS structures /// based on provided DDS Domain participant, publisher and subscriber which /// are created by the parent DDS Manager class. The method creates the reader /// and writers for Track Enumeration topic. The method returns true if all /// registrations are successfull. If method fails, it cleans up itself and /// no additional clean up is necessary. /// /// /// The "DDS::DomainParticipant ddsParticipant" parameter is provided by DDS Manager /// class and is the DDS entity existing per process /// /// /// The "DDS::Publisher ddsPublisher" parameter is provided by DDS Manager /// class and is the DDS entity existing per process /// /// /// The "DDS::Subscriber ddsSubscriberr" parameter is provided by DDS Manager /// class and is the DDS entity existing per process /// /// /// The error std::string is generated if some calls to DDS fail. The method can still return /// successful result if the error is not fatal, see method summary for details. /// /// /// bool "true" or "false" indicating success or failure of initialization process. /// virtual bool Init(int domainId, std::string& strError); /// /// shutdown ends the enumeration object. /// virtual void shutdown(); private: bool SetupTrackEvemtsDataReader(std::string& strError); bool CreateSubscriber(std::string& strError); }; } // namespace JTCWDDS