26 #ifndef C_RTDS_ADAPTER_HPP 27 #define C_RTDS_ADAPTER_HPP 31 #include <boost/enable_shared_from_this.hpp> 32 #include <boost/shared_ptr.hpp> 33 #include <boost/asio/io_service.hpp> 34 #include <boost/asio/ip/tcp.hpp> 35 #include <boost/asio/deadline_timer.hpp> 36 #include <boost/property_tree/ptree_fwd.hpp> 58 ,
public boost::enable_shared_from_this<CRtdsAdapter>
62 typedef boost::shared_ptr<CRtdsAdapter>
Pointer;
66 const boost::property_tree::ptree & ptree);
80 const boost::property_tree::ptree & ptree);
83 void Run(
const boost::system::error_code & e);
111 #endif // C_RTDS_ADAPTER_HPP void Run(const boost::system::error_code &e)
Continuous loop for sending and receiving to/from RTDS.
Definition: CRtdsAdapter.cpp:158
boost::asio::deadline_timer m_runTimer
Timer object to set communication cycle pace.
Definition: CRtdsAdapter.hpp:95
std::string m_port
The port number of the remote host.
Definition: CRtdsAdapter.hpp:104
void EndianSwapIfNeeded(std::vector< SignalValue > &v)
Swaps the endianness of all SignalValues in a vector.
Definition: CRtdsAdapter.cpp:325
~CRtdsAdapter()
Destructor.
Definition: CRtdsAdapter.cpp:286
static IAdapter::Pointer Create(boost::asio::io_service &service, const boost::property_tree::ptree &ptree)
Create a CRtdsAdapter object and returns a pointer to it.
Definition: CRtdsAdapter.cpp:85
boost::asio::ip::tcp::socket m_socket
Socket to use for the TCP connection.
Definition: CRtdsAdapter.hpp:98
Provides an interface for communicating with a RTDS simulation model.
Definition: CRtdsAdapter.hpp:56
void Stop()
Shut down communication to FPGA.
Definition: CRtdsAdapter.cpp:259
std::string m_host
The hostname of the remote host.
Definition: CRtdsAdapter.hpp:101
Buffer adapter device interface.
Definition: IBufferAdapter.hpp:47
boost::shared_ptr< CRtdsAdapter > Pointer
Pointer to an CRtdsAdapter object.
Definition: CRtdsAdapter.hpp:62
void Start()
Starts the adapter.
Definition: CRtdsAdapter.cpp:123
General FREEDM Namespace.
Definition: CBroker.cpp:53
void ReverseBytes(char *buffer, const int numBytes)
Reverses all of the bytes in a buffer.
Definition: CRtdsAdapter.cpp:301
void Connect()
Creates a socket connection to the given hostname and port number.
Definition: CRtdsAdapter.cpp:355
CRtdsAdapter(boost::asio::io_service &service, const boost::property_tree::ptree &ptree)
Constructor.
Definition: CRtdsAdapter.cpp:105
boost::shared_ptr< IAdapter > Pointer
Pointer to a physical adapter.
Definition: IAdapter.hpp:72