CatapultServer  v0.5.0.1 (Elephant)
ProcessMain.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include <boost/filesystem/path.hpp>
23 #include <functional>
24 #include <memory>
25 
26 namespace catapult {
27  namespace config { class CatapultConfiguration; }
28  namespace crypto { class KeyPair; }
29 }
30 
31 namespace catapult { namespace process {
32 
34  enum class ProcessOptions {
37 
40  };
41 
44  using CreateProcessHost = std::function<std::shared_ptr<void> (config::CatapultConfiguration&&, const crypto::KeyPair&)>;
45 
48  boost::filesystem::path GetResourcesPath(int argc, const char** argv);
49 
53  int ProcessMain(int argc, const char** argv, const std::string& host, const CreateProcessHost& createProcessHost);
54 
58  int ProcessMain(
59  int argc,
60  const char** argv,
61  const std::string& host,
62  ProcessOptions processOptions,
63  const CreateProcessHost& createProcessHost);
64 }}
catapult::config::BasicLoggerConfiguration::Level
utils::LogLevel Level
Log level.
Definition: LoggingConfiguration.h:37
Signals.h
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
ThreadInfo.h
catapult::config::GetConsoleLoggerOptions
utils::BasicLoggerOptions GetConsoleLoggerOptions(const ConsoleLoggerConfiguration &config)
Maps console logger configuration (config) to console logger options.
Definition: LoggingConfiguration.cpp:64
catapult::config::LoggingConfiguration::File
FileLoggerConfiguration File
File logger settings.
Definition: LoggingConfiguration.h:74
catapult::config::BasicLoggerConfiguration
Basic logger configuration settings.
Definition: LoggingConfiguration.h:32
catapult::process::ProcessOptions
ProcessOptions
Process options.
Definition: ProcessMain.h:34
catapult::process::CreateProcessHost
std::function< std::shared_ptr< void >(config::CatapultConfiguration &&, const crypto::KeyPair &)> CreateProcessHost
Definition: ProcessMain.h:44
catapult::utils::CatapultLogFlush
void CatapultLogFlush()
Definition: Logging.cpp:283
version.h
ExceptionLogging.h
KeyPair.h
catapult::thread::GetThreadName
std::string GetThreadName()
Gets a thread name in a platform-dependent way.
Definition: ThreadInfo.cpp:74
FileLock.h
catapult::config::LoggingConfiguration
Logging configuration settings.
Definition: LoggingConfiguration.h:68
catapult::process::ProcessOptions::Exit_After_Process_Host_Creation
Exit immediately after process host creation.
catapult::io::FileLock
Lock based on an underlying lock file.
Definition: FileLock.h:29
catapult::crypto::KeyPair
Represents a pair of private key with associated public key.
Definition: KeyPair.h:33
ValidateConfiguration.h
catapult::thread::SetThreadName
void SetThreadName(const std::string &name)
Definition: ThreadInfo.cpp:69
catapult::config::CatapultConfiguration
Comprehensive configuration for a catapult process.
Definition: CatapultConfiguration.h:34
catapult::crypto::FormatKey
utils::ContainerHexFormatter< Key::const_iterator > FormatKey(const Key &key)
Formats a public key for printing.
Definition: KeyUtils.cpp:27
forwardsValidation.info
def info(*args)
Definition: forwardsValidation.py:12
catapult::process::GetResourcesPath
boost::filesystem::path GetResourcesPath(int argc, const char **argv)
Definition: ProcessMain.cpp:90
catapult::process::ProcessOptions::Exit_After_Termination_Signal
Wait for termination signal before exiting.
catapult::process::ProcessMain
int ProcessMain(int argc, const char **argv, const std::string &host, const CreateProcessHost &createProcessHost)
Definition: ProcessMain.cpp:94
KeyUtils.h
catapult::config::ValidateConfiguration
void ValidateConfiguration(const CatapultConfiguration &config)
Validates config and throws an exception if it is invalid.
Definition: ValidateConfiguration.cpp:61
ProcessMain.h
catapult::process::WaitForTerminationSignal
void WaitForTerminationSignal()
Pauses until the program receives a termination signal.
Definition: Signals.cpp:34
CatapultConfiguration.h
catapult::config::BasicLoggerConfiguration::ComponentLevels
std::unordered_map< std::string, utils::LogLevel > ComponentLevels
Custom component log levels.
Definition: LoggingConfiguration.h:40
UNHANDLED_EXCEPTION_MESSAGE
#define UNHANDLED_EXCEPTION_MESSAGE(ACTION)
Outputs a message for an unhandled exception that occurred during ACTION.
Definition: ExceptionLogging.h:30
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::config::LoadConfiguration
TConfiguration LoadConfiguration(const boost::filesystem::path &path, TConfigurationLoader loader)
Loads configuration from path using loader.
Definition: ConfigurationFileLoader.h:34
catapult::config::GetFileLoggerOptions
utils::FileLoggerOptions GetFileLoggerOptions(const FileLoggerConfiguration &config)
Maps file logger configuration (config) to file logger options.
Definition: LoggingConfiguration.cpp:71
catapult::crypto::KeyPair::FromString
static auto FromString(const std::string &privateKey)
Creates a key pair from privateKey.
Definition: KeyPair.h:46
Logging.h
catapult::version::WriteVersionInformation
void WriteVersionInformation(std::ostream &out)
Writes custom version information to out.
Definition: version.cpp:26
catapult::config::LoggingConfiguration::Console
ConsoleLoggerConfiguration Console
Console logger settings.
Definition: LoggingConfiguration.h:71
catapult::config::CatapultConfiguration::LoadFromPath
static CatapultConfiguration LoadFromPath(const boost::filesystem::path &resourcesPath, const std::string &extensionsHost)
Definition: CatapultConfiguration.cpp:61