fastcgi++
A C++ FastCGI/Web API
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH > Struct Template Reference

For the reply of FastCGI management records. More...

#include <fastcgi++/protocol.hpp>

Public Member Functions

 ManagementReply (const char *name_, const char *value_)
 Construct the record based on the name data and value data. More...
 

Private Attributes

Header header
 Management records header. More...
 
uint8_t nameLength
 Length in bytes of name. More...
 
uint8_t valueLength
 Length in bytes of value. More...
 
uint8_t name [NAMELENGTH]
 Name data. More...
 
uint8_t value [VALUELENGTH]
 Value data. More...
 
uint8_t padding [paddingLength]
 Padding data. More...
 

Static Private Attributes

static const int paddingLength
 

Detailed Description

template<int NAMELENGTH, int VALUELENGTH>
struct Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >

For the reply of FastCGI management records.

This class template is an efficient tool for replying to RecordType::GET_VALUES management records. The structure represents a complete record (body+header) of a name-value pair to be sent as a reply to a management value query. The templating allows the structure to be exactly the size that is needed so it can be casted to raw data and transmitted as is. Note that the name and value lengths are left as single bytes so they are limited in range from 0-127.

Template Parameters
NAMELENGTHLength of name in bytes (0-127). Null terminator not included.
VALUELENGTHLength of value in bytes (0-127). Null terminator not included.
Date
March 6, 2016
Author
Eddie Carle <eddie.nosp@m.@isa.nosp@m.tec.c.nosp@m.a>

Definition at line 444 of file protocol.hpp.

Constructor & Destructor Documentation

template<int NAMELENGTH, int VALUELENGTH>
Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >::ManagementReply ( const char *  name_,
const char *  value_ 
)
inline

Construct the record based on the name data and value data.

A full record is constructed from the name-value data. After construction the structure can be casted to raw data and transmitted as is. The size of the data arrays pointed to by name_ and value_ are assumed to correspond with the NAMELENGTH and VALUELENGTH template parameters passed to the class.

Parameters
[in]name_Pointer to name data
[in]value_Pointer to value data

Definition at line 484 of file protocol.hpp.

References Fastcgipp::Protocol::Header::contentLength, Fastcgipp::Protocol::Header::fcgiId, Fastcgipp::Protocol::GET_VALUES_RESULT, Fastcgipp::Protocol::maxConnsReply, Fastcgipp::Protocol::maxReqsReply, Fastcgipp::Protocol::mpxsConnsReply, Fastcgipp::Protocol::Header::paddingLength, Fastcgipp::Protocol::Header::type, Fastcgipp::Protocol::version, and Fastcgipp::Protocol::Header::version.

Member Data Documentation

template<int NAMELENGTH, int VALUELENGTH>
Header Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >::header
private

Management records header.

Definition at line 455 of file protocol.hpp.

template<int NAMELENGTH, int VALUELENGTH>
uint8_t Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >::name[NAMELENGTH]
private

Name data.

Definition at line 464 of file protocol.hpp.

template<int NAMELENGTH, int VALUELENGTH>
uint8_t Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >::nameLength
private

Length in bytes of name.

Definition at line 458 of file protocol.hpp.

template<int NAMELENGTH, int VALUELENGTH>
uint8_t Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >::padding[paddingLength]
private

Padding data.

Definition at line 470 of file protocol.hpp.

template<int NAMELENGTH, int VALUELENGTH>
const int Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >::paddingLength
staticprivate
Initial value:
= (chunkSize-1)-(
sizeof(Header)
+2
+NAMELENGTH
+VALUELENGTH

Definition at line 447 of file protocol.hpp.

template<int NAMELENGTH, int VALUELENGTH>
uint8_t Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >::value[VALUELENGTH]
private

Value data.

Definition at line 467 of file protocol.hpp.

template<int NAMELENGTH, int VALUELENGTH>
uint8_t Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >::valueLength
private

Length in bytes of value.

Definition at line 461 of file protocol.hpp.


The documentation for this struct was generated from the following file: