fastcgi++
Public Member Functions | Private Attributes
Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH, PADDINGLENGTH > Struct Template Reference

Used for the reply of FastCGI management records of type GET_VALUES. More...

#include <protocol.hpp>

List of all members.

Public Member Functions

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

Private Attributes

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

Detailed Description

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

Used for the reply of FastCGI management records of type GET_VALUES.

This class template is an efficient tool for replying to 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.
PADDINGLENGTHLength of padding at the end of the record. This is needed to keep the record size a multiple of chunkSize.

Definition at line 379 of file protocol.hpp.


Constructor & Destructor Documentation

template<int NAMELENGTH, int VALUELENGTH, int PADDINGLENGTH>
Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH, PADDINGLENGTH >::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 PADDINGLENGTH template parameters passed to the class.

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

Definition at line 406 of file protocol.hpp.

References Fastcgipp::Protocol::GET_VALUES_RESULT, Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH, PADDINGLENGTH >::header, Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH, PADDINGLENGTH >::name, Fastcgipp::Protocol::Header::setContentLength(), Fastcgipp::Protocol::Header::setPaddingLength(), Fastcgipp::Protocol::Header::setRequestId(), Fastcgipp::Protocol::Header::setType(), Fastcgipp::Protocol::Header::setVersion(), Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH, PADDINGLENGTH >::value, and Fastcgipp::Protocol::version.


Member Data Documentation

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

Length in bytes of name.

Definition at line 385 of file protocol.hpp.

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

Padding data.

Definition at line 393 of file protocol.hpp.

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

Length in bytes of value.

Definition at line 387 of file protocol.hpp.


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