Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JStatic< T, N > Struct Template Reference

Template data structure for static member declaration. More...

#include <JStatic.hh>

Inheritance diagram for JLANG::JStatic< T, N >:
JLANG::JEquals< JStatic< T, N >, T >

Public Types

typedef JClass< T >::argument_type argument_type
 

Public Member Functions

 JStatic (argument_type value)
 Constructor.
 
JStaticoperator= (argument_type value)
 Assignment operator.
 
 operator const T & () const
 Type conversion operator.
 
 operator T& ()
 Type conversion operator.
 
const T * operator-> () const
 Smart pointer.
 
T * operator-> ()
 Smart pointer.
 
bool equals (const JStatic &object) const
 Equals method.
 
bool equals (argument_type value) const
 Equals method.
 

Static Protected Attributes

static T value
 Declaration of static data member.
 

Friends

std::istream & operator>> (std::istream &in, JStatic &object)
 Read static object from input stream.
 
std::ostream & operator<< (std::ostream &out, const JStatic &object)
 Write static object to output stream.
 

Detailed Description

template<class T, int N>
struct JLANG::JStatic< T, N >

Template data structure for static member declaration.

Definition at line 20 of file JStatic.hh.

Member Typedef Documentation

◆ argument_type

template<class T , int N>
JClass<T>::argument_type JLANG::JStatic< T, N >::argument_type

Definition at line 24 of file JStatic.hh.

Constructor & Destructor Documentation

◆ JStatic()

template<class T , int N>
JLANG::JStatic< T, N >::JStatic ( argument_type value)
inline

Constructor.

Parameters
valuevalue

Definition at line 32 of file JStatic.hh.

33 {
34 this->value = value;
35 }
static T value
Declaration of static data member.
Definition JStatic.hh:146

Member Function Documentation

◆ operator=()

template<class T , int N>
JStatic & JLANG::JStatic< T, N >::operator= ( argument_type value)
inline

Assignment operator.

Parameters
valuevalue
Returns
this value

Definition at line 44 of file JStatic.hh.

45 {
46 this->value = value;
47
48 return *this;
49 }

◆ operator const T &()

template<class T , int N>
JLANG::JStatic< T, N >::operator const T & ( ) const
inline

Type conversion operator.

Returns
value

Definition at line 57 of file JStatic.hh.

58 {
59 return value;
60 }

◆ operator T&()

template<class T , int N>
JLANG::JStatic< T, N >::operator T& ( )
inline

Type conversion operator.

Returns
value

Definition at line 68 of file JStatic.hh.

69 {
70 return value;
71 }

◆ operator->() [1/2]

template<class T , int N>
const T * JLANG::JStatic< T, N >::operator-> ( ) const
inline

Smart pointer.

Returns
value

Definition at line 79 of file JStatic.hh.

80 {
81 return &value;
82 }

◆ operator->() [2/2]

template<class T , int N>
T * JLANG::JStatic< T, N >::operator-> ( )
inline

Smart pointer.

Returns
value

Definition at line 90 of file JStatic.hh.

91 {
92 return &value;
93 }

◆ equals() [1/2]

template<class T , int N>
bool JLANG::JStatic< T, N >::equals ( const JStatic< T, N > & object) const
inline

Equals method.

Parameters
objectobject
Returns
true if this object equals given object; else false

Definition at line 102 of file JStatic.hh.

103 {
104 return this->value == object.value;
105 }

◆ equals() [2/2]

template<class T , int N>
bool JLANG::JStatic< T, N >::equals ( argument_type value) const
inline

Equals method.

Parameters
valuevalue
Returns
true if this value equals given value; else false

Definition at line 114 of file JStatic.hh.

115 {
116 return this->value == value;
117 }

Friends And Related Symbol Documentation

◆ operator>>

template<class T , int N>
std::istream & operator>> ( std::istream & in,
JStatic< T, N > & object )
friend

Read static object from input stream.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 127 of file JStatic.hh.

128 {
129 return in >> object.value;
130 }

◆ operator<<

template<class T , int N>
std::ostream & operator<< ( std::ostream & out,
const JStatic< T, N > & object )
friend

Write static object to output stream.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 140 of file JStatic.hh.

141 {
142 return out << object.value;
143 }

Member Data Documentation

◆ value

template<class T , int N>
T * JLANG::JStatic< T, N >::value
staticprotected

Declaration of static data member.

Definition at line 146 of file JStatic.hh.


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