Files
allwpilib/networktables/cpp/include/networktables2/util/StringCache.h
Brad Miller 69d9ad70ab 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
2014-04-01 11:18:29 -04:00

40 lines
684 B
C++

#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