CMake Changes

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
This commit is contained in:
Brad Miller
2014-03-24 16:13:08 -04:00
parent 33134bef1d
commit 69d9ad70ab
804 changed files with 586 additions and 9377 deletions

View File

@@ -0,0 +1,36 @@
/*
* FDIOStream.h
*
* Created on: Sep 27, 2012
* Author: Mitchell Wills
*/
#ifndef FDIOSTREAM_H_
#define FDIOSTREAM_H_
class FDIOStream;
#include "networktables2/stream/IOStream.h"
#include <stdio.h>
class FDIOStream : public IOStream{
private:
//FILE* f;
int fd;
public:
FDIOStream(int fd);
virtual ~FDIOStream();
int read(void* ptr, int numbytes);
int write(const void* ptr, int numbytes);
void flush();
void close();
};
#endif /* FDIOSTREAM_H_ */

View File

@@ -0,0 +1,25 @@
/*
* IOStream.h
*
* Created on: Sep 27, 2012
* Author: Mitchell Wills
*/
#ifndef IOSTREAM_H_
#define IOSTREAM_H_
class IOStream;
class IOStream
{
public:
virtual ~IOStream()
{
}
virtual int read(void* ptr, int numbytes) = 0;
virtual int write(const void* ptr, int numbytes) = 0;
virtual void flush() = 0;
virtual void close() = 0;
};
#endif /* IOSTREAM_H_ */

View File

@@ -0,0 +1,32 @@
/*
* IOStreamFactory.h
*
* Created on: Sep 22, 2012
* Author: Mitchell Wills
*/
#ifndef IOSTREAMFACTORY_H_
#define IOSTREAMFACTORY_H_
#include "networktables2/stream/IOStream.h"
/**
* A factory that will create the same IOStream. A stream returned by this factory should be closed before calling createStream again
*
* @author Mitchell
*
*/
class IOStreamFactory
{
public:
virtual ~IOStreamFactory()
{
}
/**
* @return create a new stream
* @throws IOException
*/
virtual IOStream* createStream() = 0;
};
#endif /* IOSTREAMFACTORY_H_ */

View File

@@ -0,0 +1,38 @@
/*
* IOStreamProvider.h
*
* Created on: Sep 22, 2012
* Author: Mitchell Wills
*/
#ifndef IOSTREAMPROVIDER_H_
#define IOSTREAMPROVIDER_H_
#include "networktables2/stream/IOStream.h"
/**
* An object that will provide the IOStream of clients to a NetworkTable Server
*
* @author mwills
*
*/
class IOStreamProvider
{
public:
virtual ~IOStreamProvider()
{
}
/**
*
* @return a new IOStream normally from a server
* @throws IOException
*/
virtual IOStream* accept() = 0;
/**
* Close the source of the IOStreams. {@link #accept()} should not be called after this is called
* @throws IOException
*/
virtual void close() = 0;
};
#endif /* IOSTREAMPROVIDER_H_ */

View File

@@ -0,0 +1,33 @@
/*
* SocketServerStreamProvider.h
*
* Created on: Sep 27, 2012
* Author: Mitchell Wills
*/
#ifndef SOCKETSERVERSTREAMPROVIDER_H_
#define SOCKETSERVERSTREAMPROVIDER_H_
class SocketServerStreamProvider;
#include "networktables2/stream/IOStream.h"
#include "networktables2/stream/IOStreamProvider.h"
class SocketServerStreamProvider : public IOStreamProvider{
private:
int serverSocket;
public:
SocketServerStreamProvider(int port);
virtual ~SocketServerStreamProvider();
IOStream* accept();
void close();
};
#endif /* SOCKETSERVERSTREAMPROVIDER_H_ */

View File

@@ -0,0 +1,36 @@
/*
* SocketStreamFactory.h
*
* Created on: Nov 3, 2012
* Author: Mitchell Wills
*/
#ifndef SOCKETSTREAMFACTORY_H_
#define SOCKETSTREAMFACTORY_H_
class SocketStreamFactory;
#include "networktables2/stream/IOStreamFactory.h"
#include <string>
/**
*
* @author mwills
*
*/
class SocketStreamFactory : public IOStreamFactory{
private:
const char* host;
const int port;
public:
SocketStreamFactory(const char* host, int port);
virtual ~SocketStreamFactory();
IOStream* createStream();
};
#endif /* SOCKETSTREAMFACTORY_H_ */

View File

@@ -0,0 +1,48 @@
/*
* SocketStreams.h
*
* Created on: Sep 27, 2012
* Author: Mitchell Wills
*/
#ifndef SOCKETSTREAMS_H_
#define SOCKETSTREAMS_H_
class SocketStreams;
#include "networktables2/stream/IOStreamFactory.h"
#include "networktables2/stream/IOStreamProvider.h"
/**
* Static factory for socket stream factories and providers
*
* @author Mitchell
*
*/
class SocketStreams {
public:
/**
* Create a new IOStream factory
* @param host
* @param port
* @return a IOStreamFactory that will create Socket Connections on the given host and port
* @throws IOException
*/
static IOStreamFactory& newStreamFactory(const char* host, int port);
/**
* Create a new IOStream provider
* @param port
* @return an IOStreamProvider for a socket server on the given port
* @throws IOException
*/
static IOStreamProvider& newStreamProvider(int port);
};
#endif /* SOCKETSTREAMS_H_ */