Files
allwpilib/networktables/cpp/include/networktables2/util/StringCache.h
Thomas Clark 323022acfd Remove "using namespace std;" from headers
[artf3605]

Change-Id: I0dc6172114608eb5e52d341be8064758faa1c781
2014-09-24 14:13:29 -04:00

38 lines
662 B
C++

#ifndef _STRINGCACHE_H_
#define _STRINGCACHE_H_
#include <map>
#include <string>
/**
* A simple cache that allows for caching the mapping of one string to another calculated one
*
* @author Mitchell
*
*/
class StringCache {
private:
std::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