mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
This is the changes made by Patrick Plenefisch converting the native code to use CMake and the CMake Maven Plugin, as opposed to the native Maven plugin. This is to allow for compatibility with newer versions of the GCC toolchain. All the cpp sources were moved from maven style directories to cpp style directories for CMake. Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593
51 lines
1.6 KiB
C++
51 lines
1.6 KiB
C++
#ifndef _NETWORKTABLEMODE_H_
|
|
#define _NETWORKTABLEMODE_H_
|
|
|
|
|
|
class NetworkTableMode;
|
|
class NetworkTableServerMode;
|
|
class NetworkTableClientMode;
|
|
|
|
#include <string>
|
|
#include "networktables2/NetworkTableNode.h"
|
|
#include "networktables2/thread/NTThreadManager.h"
|
|
|
|
typedef void (*StreamDeleter)(void*);
|
|
/**
|
|
*
|
|
* Represents a different modes that network tables can be configured in
|
|
*
|
|
* @author Mitchell
|
|
*
|
|
*/
|
|
class NetworkTableMode {
|
|
public:
|
|
|
|
/**
|
|
* @param ipAddress the IP address configured by the user
|
|
* @param port the port configured by the user
|
|
* @param threadManager the thread manager that should be used for threads in the node
|
|
* @return a new node that can back a network table
|
|
* @throws IOException
|
|
*/
|
|
virtual NetworkTableNode* CreateNode(const char* ipAddress, int port, NTThreadManager& threadManager, void*& streamFactory_out, StreamDeleter& streamDeleter_out, NetworkTableEntryTypeManager*& typeManager_out) = 0;
|
|
|
|
static NetworkTableServerMode Server;
|
|
static NetworkTableClientMode Client;
|
|
};
|
|
|
|
class NetworkTableServerMode : public NetworkTableMode{
|
|
public:
|
|
NetworkTableServerMode();
|
|
virtual NetworkTableNode* CreateNode(const char* ipAddress, int port, NTThreadManager& threadManager, void*& streamFactory_out, StreamDeleter& streamDeleter_out, NetworkTableEntryTypeManager*& typeManager_out);
|
|
};
|
|
|
|
class NetworkTableClientMode : public NetworkTableMode{
|
|
public:
|
|
NetworkTableClientMode();
|
|
virtual NetworkTableNode* CreateNode(const char* ipAddress, int port, NTThreadManager& threadManager, void*& streamFactory_out, StreamDeleter& streamDeleter_out, NetworkTableEntryTypeManager*& typeManager_out);
|
|
};
|
|
|
|
|
|
#endif
|