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,35 @@
/*
* EOFException.h
*
* Created on: Oct 1, 2012
* Author: Mitchell Wills
*/
#ifndef EOFEXCEPTION_H_
#define EOFEXCEPTION_H_
#include "networktables2/util/IOException.h"
/**
* Indicates that an EOF was encountered during an I/O operation,
* and therefore the operation could not be completed.
*/
class EOFException : public IOException{
public:
/**
* Creates an EOFException.
*/
EOFException();
virtual ~EOFException() throw ();
/**
* Implements {@link IOException}::isEOF()
*/
virtual bool isEOF();
};
#endif /* EOFEXCEPTION_H_ */

View File

@@ -0,0 +1,56 @@
/*
* IOException.h
*
* Created on: Oct 1, 2012
* Author: Mitchell Wills
*/
#ifndef IOEXCEPTION_H_
#define IOEXCEPTION_H_
#include <exception>
/**
* Inidcates that an unrecoverable I/O failure occured.
*/
class IOException : public std::exception{
public:
/**
* Creates a new IOException with the given message.
*
* @param message The message to associate with this exception.
*/
IOException(const char* message);
/**
* Creates a new IOException with the given message and
* error value.
*
* @param message The message to associate with this exception.
* @param errorValue The integer code to associate with this exception.
*/
IOException(const char* message, int errorValue);
/**
* Gets the message associated with this exception.
*
* @return The message associated with this exception.
*/
const char* what();
/**
* Determines whether this exception indicates that an EOF
* was encountered.
*
* @return True if this exception indicates that an EOF was encountered.
* False otherwise.
*/
virtual bool isEOF();
virtual ~IOException() throw ();
private:
const char* message;
int errorValue;
};
#endif /* IOEXCEPTION_H_ */

View File

@@ -0,0 +1,23 @@
/*
* IllegalStateException.h
*
* Created on: Sep 16, 2012
* Author: Mitchell Wills
*/
#ifndef ILLEGALSTATEEXCEPTION_H_
#define ILLEGALSTATEEXCEPTION_H_
#include <exception>
#include <string>
class IllegalStateException : public std::exception{
public:
IllegalStateException(const char* message);
const char* what(){return message.c_str();};
~IllegalStateException() throw ();
private:
std::string message;
};
#endif /* ILLEGALSTATEEXCEPTION_H_ */

View File

@@ -0,0 +1,39 @@
#ifndef _STRINGCACHE_H_
#define _STRINGCACHE_H_
#include <map>
#include <string>
using namespace std;
/**
* A simple cache that allows for caching the mapping of one string to another calculated one
*
* @author Mitchell
*
*/
class StringCache {
private:
map<std::string, std::string> cache;
/**
* @param input
* @return the value for a given input
*/
public:
StringCache();
virtual ~StringCache();
std::string& Get(const std::string& input);
/**
* Will only be called if a value has not already been calculated
* @param input
* @return the calculated value for a given input
*/
virtual std::string Calc(const std::string& input) = 0;
};
#endif

View File

@@ -0,0 +1,37 @@
/*
* System.h
*
* For some platform specific code related to the system
*
* Created on: Sep 25, 2012
* Author: Mitchell Wills
*/
#ifndef TIME_H_
#define TIME_H_
/**
* Causes the current thread to sleep at least the
* given number of milliseconds.
*
* @param ms The number of milliseconds to sleep.
*/
void sleep_ms(unsigned long ms);
/**
* Retrieves the current time in milliseconds.
*
* @return The current time in milliseconds.
*/
unsigned long currentTimeMillis();
/**
* Writes a warning message to the standard error
* stream.
*
* @param message The string message to write.
*/
void writeWarning(const char* message);
#endif /* TIME_H_ */