Classes | |
class | ConfigureServer |
A class used for step-by-step construction and configuration of a server. More... | |
class | ConfigureServerData |
struct | FileLoadAttempt |
struct | ResolveRefResult |
class | Server |
Class handling a run-loop with a registration context and connection. More... | |
struct | ServerCreationFailure |
class | ServerImpl |
Private implementation class for Server. More... | |
class | TemporaryThreadIDChanger |
Class to temporarily (in RAII style) change a thread ID variable to the current thread, then back again when we leave scope. More... | |
Typedefs | |
typedef void(* | ShutdownHandler )() |
The type of a shutdown handler callback. | |
typedef std::function< void()> | MainloopMethod |
A function that can be registered by the server app to run in each mainloop iteration. | |
typedef shared_ptr< Server > | ServerPtr |
How one should hold a Server. | |
typedef weak_ptr< Server > | ServerWeakPtr |
How one might observe a Server without owning it. | |
using | FileLoadAttempts = std::vector< FileLoadAttempt > |
Enumerations | |
enum | FileLoadStatus { CouldNotOpenFile, CouldNotParseFile, FileOpenedAndParsed } |
enum | ValueHandledAs { Filename, String, JsonRefToFile, Other } |
Functions | |
OSVR_SERVER_EXPORT std::vector < std::string > | getDefaultConfigFilePaths () |
this returns a vector of default server configuration file paths. | |
const char * | getDefaultConfigFilename () |
OSVR_SERVER_EXPORT ServerPtr | configureServerFromFile (std::string const &configName) |
This uses a file name to attempt to configure the server with that config file. Pass an empty string to use the default config. This is the basic common code of a server app's setup, ripped out of the main server app to make alternate server-acting apps simpler to develop. | |
OSVR_SERVER_EXPORT ServerPtr | configureServerFromString (std::string const &json) |
OSVR_SERVER_EXPORT ServerPtr | configureServerFromFirstFileInList (std::vector< std::string > const &configNames) |
This iterates over a vector that contains a list of potential config files, and uses the first working one to create the server instance. | |
std::string | getUserConfigDirectory () |
void | printJsonReferenceResolutionAttempts (ResolveRefResult const &refReturn) |
void | reportErrorInJsonReferenceParsing (const char *description, Json::Value const &input, ResolveRefResult const &refReturn) |
ResolveRefResult | resolvePossibleRefWithDetails (Json::Value const &input, bool stringAcceptableResult, std::vector< std::string > const &searchPath) |
Json::Value | resolvePossibleRef (Json::Value const &input, bool stringAcceptableResult=false, std::vector< std::string > const &searchPath=std::vector< std::string >()) |
Given an input that might be a filename, might be a JSON Pointer-style $ref object, and might just directly be an object, return the object desired. More... | |
const char * | fileLoadStatusToString (FileLoadStatus status) |
Server functionality.
ResolveRefResult osvr::server::resolvePossibleRefWithDetails | ( | Json::Value const & | input, |
bool | stringAcceptableResult, | ||
std::vector< std::string > const & | searchPath | ||
) |
Definition at line 101 of file JSONResolvePossibleRef.cpp.
Json::Value osvr::server::resolvePossibleRef | ( | Json::Value const & | input, |
bool | stringAcceptableResult = false , |
||
std::vector< std::string > const & | searchPath = std::vector< std::string >() |
||
) |
Given an input that might be a filename, might be a JSON Pointer-style $ref object, and might just directly be an object, return the object desired.
If just a string (suggesting it was intended to be a reference), returns null.
stringAcceptableResult | Determines whether a string that we can't resolve to a loadable JSON reference should be returned as itself (valid, true), or should be signaled as an error by returning null (false, default) |
searchPath | Optional list of directories to look for any mentioned files. |
This function is the same as "withDetails", just less rich.
Definition at line 138 of file JSONResolvePossibleRef.cpp.