core::memory_allocator::MemoryAllocationLayout core::memory_allocator::MemoryAllocator::layout( const struct MemoryAllocationRequest& request) { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); validateRequest(request); LayoutBuilder builder(m_systemCapabilities, m_nvmLib); core::memory_allocator::MemoryAllocationLayout layout = builder.build(request); validateLayout(request, layout); return layout; }
void Server::run() { std::string result; Envelope receivedEnv; Envelope broadcastEnv; while (true) { // Receive any incoming request receivedEnv = Envelope(retrieveSerialData()); FILE_LOG(logDEBUG) << "Retrieved Envelope: '" << receivedEnv.toString() << "'"; // Verify request is intended for this server FILE_LOG(logDEBUG) << "Verifying Request is from Server."; if (receivedEnv.getServer() != name && receivedEnv.getServer() != "") { FILE_LOG(logDEBUG) << "NOT for this server CONFIRMED, SKIPPING"; continue; } // Make sure the request is sensible and allowed FILE_LOG(logDEBUG) << "For this server CONFIRMED"; FILE_LOG(logDEBUG) << "Attempting to verfiy the request"; result = validateRequest(receivedEnv); // Request is for the server if (result == "server") { FILE_LOG(logDEBUG) << "Envelope passed verification as server request..."; result = IRCHandler(receivedEnv.getExpression()); FILE_LOG(logDEBUG) << "IRCHandler Result: '" << result << "'" ; // Setup broadcast with result, from "server" to requester broadcastEnv = Envelope(name, receivedEnv.getSender(), "server", result); } // Request is targeted at a channel else if (result == "channel") { FILE_LOG(logDEBUG) << "Envelope passed verification as channel request ..."; result = IRCHandler(receivedEnv.getExpression()); FILE_LOG(logDEBUG) << "IRCHandler Result: '" << result << "'"; broadcastEnv = Envelope(name, receivedEnv.getDestination(), receivedEnv.getSender(), result); } else { FILE_LOG(logDEBUG) << "Envelope failed verification..."; broadcastEnv = Envelope(name, receivedEnv.getSender(), "server", result); FILE_LOG(logDEBUG) << "Failure notification sent..."; } // Broadcast the result of the request broadcastSerialData(broadcastEnv.toString()); } }
RCSSeparateResponse::RCSSeparateResponse(RCSRequest&& request) : m_request{ std::move(request) }, m_done{ false } { validateRequest(m_request); }
RCSSeparateResponse::RCSSeparateResponse(const RCSRequest& request) : m_request{ request }, m_done{ false } { validateRequest(m_request); }