Add exception-generating C++ functions, but mark as deprecated.

These are good to have for backwards compatibility, but discouraged for new
development (default-taking functions should be used instead).  The reason
is that the exceptions must be explicitly handled and may initially work but
then fail at an inopportune moment.

Mark the similar Java functions as deprecated as well for the same reason.

Update all the docs for consistency.

Mark overridden functions as such in both C++ and Java.

Make IsPersistent and GetFlags const in C++.
This commit is contained in:
Peter Johnson
2015-12-06 22:39:38 -08:00
parent 9e6635ec13
commit 76ee093e92
7 changed files with 538 additions and 462 deletions

View File

@@ -0,0 +1,30 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2015. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef TABLEKEYNOTDEFINEDEXCEPTION_H_
#define TABLEKEYNOTDEFINEDEXCEPTION_H_
#include <exception>
#include "llvm/StringRef.h"
/**
* An exception thrown when the lookup a a key-value fails in a {@link ITable}
*/
class TableKeyNotDefinedException : public std::exception {
public:
/**
* @param key the key that was not defined in the table
*/
TableKeyNotDefinedException(llvm::StringRef key);
~TableKeyNotDefinedException() noexcept;
const char* what();
private:
std::string msg;
};
#endif // TABLEKEYNOTDEFINEDEXCEPTION_H_