C++ Classes Reference
This section summarizes the classes and templates that are present in the current source tree.
Core Runtime
Server
Server inherits from ASProcessHandler and ClientHandler and coordinates startup,
socket setup, signal handling, and the main poll loop.
-
class Server
-
void init()
-
void setupSocket()
-
void setupPoll()
-
void ServerLoop()
-
void acceptClient()
-
static void addChildPID(pid_t)
-
static void terminateChildren()
-
void init()
setupSharedMemory() currently exists as an empty hook in src/Server.cpp.
Client
Client inherits from HTTPParser and stores the socket file descriptor plus a reusable
receive buffer pointer.
receiveData() repeatedly reads from the client socket until the kernel buffer is drained, EOF
is reached, or a hard receive error occurs.
ClientHandler
ClientHandler owns the active client map and epoll state.
Configuration and Filesystem
Configuration
Configuration loads config/config.json and maps namespace definitions to runtime objects.
Filesystem
Filesystem indexes static files and their metadata.
-
class Filesystem
- typedef struct FileProperties_t
- typedef vector<string> FilelistPlain_t
- typedef unordered_map<string, const FileProperties_t> FileListExtended_t
-
void initFiles()
-
void processFileProperties()
-
FileProperties_t getFilePropertiesByFile(const string &File)
-
bool checkFileExists(const string &File)
-
string getFileEtag(const string &File)
Backend Support
ASProcessHandler
ASProcessHandler currently provides the lifecycle interface for backend child processes and the
configured interpreter count.
HTTP Library
HTTPParser
HTTPParser is the reusable request parser from lib/http/httpparser.*.
HTTPMessageGenerator
The message-generator component is implemented by HTTPGenerator.
-
class HTTPGenerator
- typedef unordered_map<HeaderID_t, HeaderValue_t> ResponseHeader_t
-
void MsgReset()
-
void MsgSetStatus(const uint16_t, const string&)
-
void MsgAddHeader(const HeaderID_t, const HeaderValue_t)
-
void MsgAddDateHeader()
-
void MsgSetBodyRef(const unsigned char*, const unsigned int)
-
void MsgGenerate()
-
SendMetadata_t MsgGetSendMetadata()
-
bool MsgUpdateSendMetadata(ssize_t)
Utilities
MemoryManager
MemoryManager<T> provides aligned segmented storage used by the runtime for reusable buffers.
SHMVector
SHMVector<T> in src/SHMVector.hpp is the shared-memory-safe vector implementation.
CPU
CPU contains CPU affinity helper methods used by process-oriented runtime code.
Vector
Vector contains custom helper functionality for vector-style containers.