FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
Network rules

Everything related to network rules. More...

Classes

struct  fge::net::rules::ChainedArguments< TValue >
 This is a wrapper around a Packet and a value for safe extraction. More...
 
enum class  ROutputs : bool { R_NORMAL = false , R_INVERTED = true }
 
template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
constexpr ChainedArguments< TValue > fge::net::rules::RRange (TValue const &min, TValue const &max, ChainedArguments< TValue > &&args)
 Range rule, check if the value is in the min/max range.
 
template<class TValue >
constexpr ChainedArguments< TValue > fge::net::rules::RValid (ChainedArguments< TValue > &&args)
 Valid rule, check if the value is correctly extracted.
 
template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
constexpr ChainedArguments< TValue > fge::net::rules::RMustEqual (TValue const &a, ChainedArguments< TValue > &&args)
 Must equal rule, check if the value is equal to the provided one.
 
template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
constexpr ChainedArguments< TValue > fge::net::rules::RStrictLess (TValue less, ChainedArguments< TValue > &&args)
 Strict less rule, check if the value is strictly lesser than the provided one.
 
template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
constexpr ChainedArguments< TValue > fge::net::rules::RLess (TValue less, ChainedArguments< TValue > &&args)
 Less rule, check if the value is lesser than the provided one.
 
template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
constexpr ChainedArguments< TValue > fge::net::rules::RSizeRange (SizeType min, SizeType max, ChainedArguments< TValue > &&args)
 Size range rule, check if the size is in the min/max range.
 
template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
constexpr ChainedArguments< TValue > fge::net::rules::RSizeMustEqual (fge::net::SizeType a, ChainedArguments< TValue > &&args)
 Size must equal rule, check if the size is equal to the provided one.
 
template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
constexpr ChainedArguments< TValue > fge::net::rules::RMustValidUtf8 (ChainedArguments< TValue > &&args)
 Check if the extracted string is a valid UTF8 string.
 

Detailed Description

Everything related to network rules.

Network rules are utilities that make sure that the data inside of a packet is valid before extracting and using it.

Function Documentation

◆ RLess()

template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
ChainedArguments< TValue > fge::net::rules::RLess ( TValue less,
ChainedArguments< TValue > && args )
constexpr

Less rule, check if the value is lesser than the provided one.

Template Parameters
TValueThe type of the value
TOutputControl how the rule will output
Parameters
lessThe value that will be compared
argsThe chained argument
Returns
The chained argument

◆ RMustEqual()

template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
ChainedArguments< TValue > fge::net::rules::RMustEqual ( TValue const & a,
ChainedArguments< TValue > && args )
constexpr

Must equal rule, check if the value is equal to the provided one.

Template Parameters
TValueThe type of the value
TOutputControl how the rule will output
Parameters
aThe value that will be compared
argsThe chained argument
Returns
The chained argument

◆ RMustValidUtf8()

template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
ChainedArguments< TValue > fge::net::rules::RMustValidUtf8 ( ChainedArguments< TValue > && args)
constexpr

Check if the extracted string is a valid UTF8 string.

This function will extract the string, make sure that you apply size rules before in order to avoid bad extraction.

Template Parameters
TValueThe type of the value
TOutputControl how the rule will output
Parameters
argsThe chained argument
Returns
The chained argument

◆ RRange()

template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
ChainedArguments< TValue > fge::net::rules::RRange ( TValue const & min,
TValue const & max,
ChainedArguments< TValue > && args )
constexpr

Range rule, check if the value is in the min/max range.

The comparison is not strict for min/max.

Template Parameters
TValueThe type of the value
TOutputControl how the rule will output
Parameters
minThe minimum range
maxThe maximum range
argsThe chained argument
Returns
The chained argument

◆ RSizeMustEqual()

template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
ChainedArguments< TValue > fge::net::rules::RSizeMustEqual ( fge::net::SizeType a,
ChainedArguments< TValue > && args )
constexpr

Size must equal rule, check if the size is equal to the provided one.

See also
RSizeRange
Template Parameters
TValueThe type of the value
TOutputControl how the rule will output
Parameters
aThe value that will be compared
argsThe chained argument
Returns
The chained argument

◆ RSizeRange()

template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
ChainedArguments< TValue > fge::net::rules::RSizeRange ( SizeType min,
SizeType max,
ChainedArguments< TValue > && args )
constexpr

Size range rule, check if the size is in the min/max range.

This function will peek the current fge::net::SizeType at read pos. It is useful to apply rules on the size of something (string, container, ...) before extracting it.

The actual value will not be extracted here.

Template Parameters
TValueThe type of the value
TOutputControl how the rule will output
Parameters
minThe minimum range
maxThe maximum range
argsThe chained argument
Returns
The chained argument

◆ RStrictLess()

template<class TValue , ROutputs TOutput = ROutputs::R_NORMAL>
ChainedArguments< TValue > fge::net::rules::RStrictLess ( TValue less,
ChainedArguments< TValue > && args )
constexpr

Strict less rule, check if the value is strictly lesser than the provided one.

Template Parameters
TValueThe type of the value
TOutputControl how the rule will output
Parameters
lessThe value that will be compared
argsThe chained argument
Returns
The chained argument

◆ RValid()

template<class TValue >
ChainedArguments< TValue > fge::net::rules::RValid ( ChainedArguments< TValue > && args)
constexpr

Valid rule, check if the value is correctly extracted.

Template Parameters
TValueThe type of the value
Parameters
argsThe chained argument
Returns
The chained argument