The RMP Motion Controller APIs
RapidSequencerAPI.h
1#pragma once
2#ifndef _SEQUENCERAPI_H
3#define _SEQUENCERAPI_H
4
5#ifdef SQAPI_EXPORT
6#define SQ_API __declspec(dllexport)
7#else
8#define SQ_API __declspec(dllimport)
9#endif
10
11#include <cstdint>
12
14namespace RSI
15{
17 namespace RapidSequencer
18 {
20 namespace API
21 {
24
26 enum class Platform
27 {
29 Uninitalized = 0,
31 Windows,
33 INtime
34 };
35
37 enum class DiscoveryType
38 {
40 All,
42 Local_All,
44 Local_Windows,
46 Local_Intime,
47 };
48
50
53
56 {
57 private:
58 struct ServerInfoImpl;
59 ServerInfoImpl* implPtr;
60
61 public:
62 ServerInfo(); // Default constructor
63 ServerInfo(const ServerInfo&); // Copy constructor
64 ServerInfo& operator=(const ServerInfo&); // Copy assignment constructor
65 ServerInfo(ServerInfo&&) noexcept; // Move constructor
66 ServerInfo& operator=(ServerInfo&&) noexcept; // Move assignment constructor
67 ~ServerInfo(); // Destructor
68
70 const char* const AddressGet() const;
72 void AddressSet(const char* const);
73
75 int32_t PortGet() const;
77 void PortSet(const int32_t);
78
80 const char* const NameGet() const;
82 void NameSet(const char* const);
83
85 uint64_t IdGet() const;
87 void IdSet(const uint64_t);
88 };
89
92 {
93 private:
94 struct ServerInfoCollectionImpl;
95 ServerInfoCollectionImpl* implPtr;
96
97 public:
98 ServerInfoCollection(); // Default constructor
99 ServerInfoCollection(const ServerInfoCollection&); // Copy constructor
100 ServerInfoCollection& operator=(const ServerInfoCollection&); // Copy assignment constructor
101 ServerInfoCollection(ServerInfoCollection&&) noexcept; // Move constructor
102 ServerInfoCollection& operator=(ServerInfoCollection&&) noexcept; // Move assignment constructor
103 ~ServerInfoCollection(); // Destructor
104
108 const ServerInfo& ServerInfoGet(uint32_t index) const;
110 size_t ServerCount() const;
111 };
112
114
117
125 SQ_API ServerInfoCollection DiscoverBroadcast(DiscoveryType discovery_type, uint16_t expected_servers = 0, const char* const node_name = "NodeB", const uint64_t timeout_ms = 2500, const int32_t broadcast_port = 60061);
126
134 SQ_API ServerInfoCollection DiscoverSpecific(DiscoveryType discovery_type, const ServerInfoCollection& expected_servers, const char* const node_name = "NodeB", const uint64_t timeout_ms = 2500, const int32_t broadcast_port = 60061);
135
136 SQ_API ServerInfoCollection DiscoverLocal(const char* const node_name = "NodeB");
137
138 SQ_API ServerInfoCollection DiscoverLocalWindows();
139
140 SQ_API ServerInfoCollection DiscoverLocalINtime(const char* const node_name = "NodeB");
141
152 SQ_API ServerInfo Start(Platform _platform, const char* const _nodeName, const char* const rmp_node, const char* const executable_path,
153 const int32_t grpc_port = 50051, const char* const friendly_name = "RapidServer", const uint64_t timeout_ms = 1000, const int32_t broadcast_port = 60061);
154
156 SQ_API void KillAll();
157
159 }
160 }
161}
162#endif // !
A container for ServerInfo objects.
void ServerInfoAdd(const ServerInfo &)
Add a ServerInfo object to this collection.
const ServerInfo & ServerInfoGet(uint32_t index) const
Get the ServerInfo object at the specified index.
size_t ServerCount() const
Get the number of ServerInfo objects in this collection.
An object containing the IP Address, the port, and the Id of a RapidServer instance.
void PortSet(const int32_t)
Sets the port number of this object.
const char *const NameGet() const
Returns the friendly name a RapidServer.
void AddressSet(const char *const)
Sets the IP Address of this object using the IPV4 format: "###.###.###.###".
uint64_t IdGet() const
Returns the unique identifier of a RapidServer.
void NameSet(const char *const)
Set the name of this object.
const char *const AddressGet() const
Returns the IP Address of a RapidServer using the IPV4 format: "###.###.###.###".
int32_t PortGet() const
Returns the port number of a RapidServer.
void IdSet(const uint64_t)
Set the unique identifier of this object.
Platform
Enum for which platform / operating system to run RapidServer on.
DiscoveryType
Enum for which platform / operating system to discover RapidServer instances on.
ServerInfoCollection DiscoverSpecific(DiscoveryType discovery_type, const ServerInfoCollection &expected_servers, const char *const node_name="NodeB", const uint64_t timeout_ms=2500, const int32_t broadcast_port=60061)
Discover the active RapidServer processes and return a collection of ServerInfo objects.
ServerInfoCollection DiscoverBroadcast(DiscoveryType discovery_type, uint16_t expected_servers=0, const char *const node_name="NodeB", const uint64_t timeout_ms=2500, const int32_t broadcast_port=60061)
Discover the active RapidServer processes and return a collection of ServerInfo objects.
ServerInfo Start(Platform _platform, const char *const _nodeName, const char *const rmp_node, const char *const executable_path, const int32_t grpc_port=50051, const char *const friendly_name="RapidServer", const uint64_t timeout_ms=1000, const int32_t broadcast_port=60061)
Starts a RapidServer instance and confirms that the server process is started.
void KillAll()
Kills all RapidServer processes.