Lolly 1.4.28
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
whitebox_rep< T > Class Template Reference

#include <blackbox.hpp>

Inheritance diagram for whitebox_rep< T >:
Inheritance graph
[legend]
Collaboration diagram for whitebox_rep< T >:
Collaboration graph
[legend]

Public Member Functions

 whitebox_rep (const T &data2)
 Constructor.
 
 ~whitebox_rep ()
 
int get_type ()
 Get the type of the whitebox representation.
 
bool equal (blackbox_rep *ptr)
 Check if the whitebox representation is equal to another blackbox_rep pointer.
 
tm_ostreamdisplay (tm_ostream &out)
 Display the whitebox representation.
 
- Public Member Functions inherited from blackbox_rep
 blackbox_rep ()
 
virtual ~blackbox_rep ()
 
- Public Member Functions inherited from abstract_struct
 abstract_struct ()
 Default constructor for the abstract object. Sets the reference count to 0.
 
virtual ~abstract_struct ()
 Virtual destructor for the abstract object. Decrements the reference count.
 

Public Attributes

data
 
- Public Attributes inherited from abstract_struct
int ref_count
 The reference count for the abstract object.
 

Detailed Description

template<class T>
class whitebox_rep< T >

Definition at line 31 of file blackbox.hpp.

Constructor & Destructor Documentation

◆ whitebox_rep()

template<class T >
whitebox_rep< T >::whitebox_rep ( const T & data2)
inline

Constructor.

Parameters
data2The data to be stored in the whitebox.

Definition at line 40 of file blackbox.hpp.

40: data (data2) {}
The list class represents a linked list.
Definition list.hpp:48

◆ ~whitebox_rep()

template<class T >
whitebox_rep< T >::~whitebox_rep ( )
inline

Definition at line 41 of file blackbox.hpp.

41{}

Member Function Documentation

◆ get_type()

template<class T >
int whitebox_rep< T >::get_type ( )
inlinevirtual

Get the type of the whitebox representation.

Returns
The type of the whitebox representation.

Implements blackbox_rep.

Definition at line 47 of file blackbox.hpp.

47{ return type_helper<T>::id; }
Helper struct for type identification and initialization.
Definition basic.hpp:303

◆ equal()

template<class T >
bool whitebox_rep< T >::equal ( blackbox_rep * ptr)
inlinevirtual

Check if the whitebox representation is equal to another blackbox_rep pointer.

Parameters
ptrA pointer to another blackbox_rep.
Returns
True if the whitebox representation is equal to the other blackbox_rep, false otherwise.

Implements blackbox_rep.

Definition at line 56 of file blackbox.hpp.

56 {
57 return ptr != NULL && ptr->get_type () == type_helper<T>::id &&
58 ((whitebox_rep<T>*) ptr)->data == data;
59 }

◆ display()

template<class T >
tm_ostream & whitebox_rep< T >::display ( tm_ostream & out)
inlinevirtual

Display the whitebox representation.

Parameters
outThe output stream to display the whitebox representation.
Returns
The output stream after displaying the whitebox representation.

Implements blackbox_rep.

Definition at line 66 of file blackbox.hpp.

66{ return out << data; }

Member Data Documentation

◆ data

template<class T >
T whitebox_rep< T >::data

The data stored in the whitebox.

Definition at line 33 of file blackbox.hpp.


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