|
Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages
DGD Namespace Reference
Depression Glass namespace. More...
Compounds
Typedefs
Enumerations
Functions
- void assoc (std::ostream *s, channel &channel, const Assoc_type action)
- Associate physical stream with a channel.
- void assoc (std::ostream &s, channel &cnl, const Assoc_type action)
- Associate physical stream with a channel.
- void assoc (std::ostream *s, const std::string &name, const Assoc_type action)
- Associate physical stream with a channel.
- std::ostream & operator<< (std::ostream &cnl, const channel_manip_void &manip)
- Apply channel_manip_void on channel.
- std::ostream & operator<< (std::ostream &cnl, const channel_manip_bool &manip)
- Apply channel_manip_bool on channel.
- std::ostream & operator<< (std::ostream &cnl, const channel_manip_uint &manip)
- Apply channel_manip_unit on channel.
- channel & operator<< (std::ostream &cnl, const channel_manip_nop &manip)
- std::ostream to DGD::channel convertor.
- channel_manip_uint step (unsigned int s)
- Change indentation step manipulator.
- channel_manip_uint indent (unsigned int s)
- Change indentation level manipulator.
- channel_manip_uint minwidth (unsigned int s)
- Change minimum line width manipulator.
- channel_manip_uint maxwidth (unsigned int s)
- Change maximum line width manipulator.
- channel_manip_bool wrap (bool s)
- Enable/disable character wrapping manipulator.
- channel_manip_bool word_wrap (bool s)
- Enable/disable word wrapping manipulator.
- template<class First_type, class Second_type> channel & operator<< (channel &cnl, const std::pair< First_type, Second_type > &p)
- Pair output operator.
- template<> channel & operator<< (channel &cnl, const std::pair< int, char ** > ¶ms)
- Specialzation of pair output operator.
- template<class Item_type> channel & operator<< (channel &cnl, const std::list< Item_type > &l)
- List output operator.
- template<class Item_type> channel & operator<< (channel &cnl, const std::vector< Item_type > &v)
- Vector output operator.
- template<class Key_type, class Value_type> channel & operator<< (channel &cnl, const std::map< Key_type, Value_type > &m)
- Map output operator.
- template<class InputIter> channel & dgd_copy (InputIter begin, InputIter end, channel &ch, const char *sep=NULL)
- Copy a sequence denoted by begin and end iterators into DGD::channel.
- template<class Circulator> channel & dgd_copy (Circulator begin, channel &ch, const char *sep=NULL)
- Copy a sequence denoted by begin circulator into DGD::channel.
- template<class Iterator> dgd_sequence< Iterator > dgd_make_sequence (const Iterator &begin, const Iterator &end, const char *separator="")
- Factory for creating dgd_sequence() objects.
- template<class Circulator> dgd_circle< Circulator > dgd_make_circle (const Circulator &begin, const char *separator="")
- Factory for creating dgd_circle() objects.
- template<class Iterator> channel & operator<< (channel &cnl, const dgd_sequence< Iterator > &seq)
- Output operator for DGD::dgd_sequence.
- template<class Circulator> channel & operator<< (channel &cnl, const dgd_circle< Circulator > &circle)
- Output operator for DGD::dgd_circle.
- template<class T> dgd_reference< T > mem_ref (const T *const p, const bool use_as_void=true, const unsigned int size=0)
- Memory reference manipulator.
- template<class T> dgd_reference< T > mem (const T *const p, const unsigned int size=sizeof(T), const bool use_as_void=true)
- Memory reference manipulator.
- template<class T> std::ostream & operator<< (std::ostream &cnl, const dgd_reference< T > &ptr)
- Output operator for pointer and memory dump.
- template<class T> dgd_safe_ptr< T > ptr (const T *const p)
- Safe pointer manipulator.
- template<class T> channel & operator<< (channel &cnl, const dgd_safe_ptr< T > &ptr)
- Output operator for safe pointer.
Variables
Detailed Description
Depression Glass namespace.
Typedef Documentation
| Alias for channel_manip<bool>. |
| Alias for channel_manip<unsigned int>. |
typedef boost::shared_ptr< std::ostream > DGD::stream |
|
| Right now DGD::stream is a simple smart pointer to any std::ostream or its children. - See also:
- DGD::debug
DGD::assoc()
|
Enumeration Type Documentation
| - Enumeration values:
Assoc_Append | | Assoc_Assign | | Assoc_Prepend | | Assoc_Delete | |
|
Function Documentation
void DGD::assoc | ( | std::ostream * | s, | | | channel & | channel, | | | const Assoc_type | action = Assoc_Append | | ) | |
|
| Associate physical stream with a channel. See DGD::channel documentation for more information. - Warning:
- DGD provides no limit on number of channels associated with the same physical stream (like std::cout). But it is not recommended to associate more then one channel with the same physical stream. In fact, unexpected formatting results can occur. Instead you can associate multiple channels with a single DGD::channel.
- Parameters:
action | - affects the operation performed with the association list. Assoc_Assign will clear the list before appending, Assoc_Append and Assoc_Prepend will put the pointer at the end or at the beginning of the list. Assoc_Delete will remove the stream from the association list. |
- See also:
- DGD::channelbuf
channelbuf::assoc(std::ostream*)
|
void DGD::assoc | ( | std::ostream & | s, | | | channel & | cnl, | | | const Assoc_type | action = Assoc_Append | | ) | |
|
| Associate physical stream with a channel. See DGD::channel documentation for more information. This one is a simple alias to assoc(std::ostream*,channel& channel). - Warning:
- DGD provides no limit on number of channels associated with the same physical stream (like std::cout). But it is not recommended to associate more then one channel with the same physical stream. In fact, unexpected formatting results can occur. Instead you can associate multiple channels with a single DGD::channel.
- Parameters:
action | - affects the operation performed with the association list. Assoc_Assign will clear the list before appending, Assoc_Append and Assoc_Prepend will put the pointer at the end or at the beginning of the list. Assoc_Delete will remove the stream from the association list. |
- See also:
- DGD::channelbuf
channelbuf::assoc(std::ostream*) assoc(std::ostream*,channel& channel)
|
void DGD::assoc | ( | std::ostream * | s, | | | const std::string & | name, | | | const Assoc_type | action = Assoc_Append | | ) | |
|
| Associate physical stream with a channel. This function acts as void assoc(std::ostream*,channel&), but takes name of the channel instead. The DGD::Debug factory is searched for the channel with the given name. See DGD::channel documentation for more information. - Warning:
- DGD provides no limit on number of channels associated with the same physical stream (like std::cout). But it is not recommended to associate more then one channel with the same physical stream. In fact, unexpected formatting results can occur. Instead you can associate multiple channels with a single DGD::channel.
- Parameters:
action | - affects the operation performed with the association list. Assoc_Assign will clear the list before appending, Assoc_Append and Assoc_Prepend will put the pointer at the end or at the beginning of the list. Assoc_Delete will remove the stream from the association list. |
- See also:
- DGD::channelbuf
channelbuf::assoc(std::ostream*)
|
| Apply channel_manip_bool on channel. |
| Apply channel_manip_unit on channel. |
template<class First_type, class Second_type> | channel& operator<< | ( | channel & | cnl, | | | const std::pair< First_type, Second_type > & | p | | ) | [inline] |
|
| Pair output operator. Will print a pair in a form "[first second]" |
template<> | channel& operator<< | ( | channel & | cnl, | | | const std::pair< int, char ** > & | params | | ) | [inline] |
|
| Specialzation of pair output operator. This one is used when printing an option set <int argc, char** argv> received by main(). Prints space separated options. |
template<class Item_type> | channel& operator<< | ( | channel & | cnl, | | | const std::list< Item_type > & | l | | ) | [inline] |
|
| List output operator. Prints list in form: |
template<class Item_type> | channel& operator<< | ( | channel & | cnl, | | | const std::vector< Item_type > & | v | | ) | [inline] |
|
| Vector output operator. Prints vector in form: |
template<class Key_type, class Value_type> | channel& operator<< | ( | channel & | cnl, | | | const std::map< Key_type, Value_type > & | m | | ) | [inline] |
|
| Map output operator. Prints map in form: Order of elements is defined by std::map<...>::iterator |
template<class InputIter> | channel& dgd_copy | ( | InputIter | begin, | | | InputIter | end, | | | channel & | ch, | | | const char * | sep = NULL | | ) | |
|
| Copy a sequence denoted by begin and end iterators into DGD::channel. This function is similar to std::copy() but accepts DGD::channel as the output parameter. It is important that begin and end iterators are set to the same sequence and their value_type has operator<<() compatible with DGD::channel. - Parameters:
begin | sequence starting iterator | end | sequence end iterator | ch | destination channel | sep | separator string |
- Returns:
- reference to the output DGD::channel
|
template<class Circulator> | channel& dgd_copy | ( | Circulator | begin, | | | channel & | ch, | | | const char * | sep = NULL | | ) | |
|
| Copy a sequence denoted by begin circulator into DGD::channel. This function assumes that circulator returns to the self value after finite number of steps. It is important that its value_type has operator<<() compatible with DGD::channel. - Parameters:
begin | circulator | ch | destination channel | sep | separator string |
- Returns:
- reference to the output DGD::channel
|
template<class Iterator> | dgd_sequence<Iterator> dgd_make_sequence | ( | const Iterator & | begin, | | | const Iterator & | end, | | | const char * | separator = " " | | ) | |
|
| Factory for creating dgd_sequence() objects. |
template<class Circulator> | dgd_circle<Circulator> dgd_make_circle | ( | const Circulator & | begin, | | | const char * | separator = " " | | ) | |
|
| Factory for creating dgd_circle() objects. |
template<class T> | dgd_reference<T> mem_ref | ( | const T *const | p, | | | const bool | use_as_void = true, | | | const unsigned int | size = 0 | | ) | [inline] |
|
| Memory reference manipulator. This function is used as a DGD::channel manipulator for pointer formatting. It returns dgd_reference representing the memory pointer or block. The default values are set for T* pointer representation without hexa memory dump. - Parameters:
p | - pointer to type T. This pointer is used for referencing only so it is full const. | use_as_void | - if true the p pointer will be treated as void*, otherwise it will be treated as T* and printed in form (T*)0xXXXXXXXX. | size | - if greater then zero p will be treated as a pointer to a memory block of that size, and when printed it will appear as hexa dump. |
- See also:
- DGD::mem()
|
template<class T> | dgd_reference<T> mem | ( | const T *const | p, | | | const unsigned int | size = sizeof(T), | | | const bool | use_as_void = true | | ) | [inline] |
|
| Memory reference manipulator. This function is almost identical to DGD::mem_ref(), the only difference that default values are set to T* pointer with hexa memory dump of T. - See also:
- DGD::mem_ref()
|
template<class T> | std::ostream& operator<< | ( | std::ostream & | cnl, | | | const dgd_reference< T > & | ptr | | ) | [inline] |
|
| Output operator for pointer and memory dump. Prints out pointer hex value, and optionally it's type and hexa dump of referenced memory. |
template<class T> | dgd_safe_ptr<T> ptr | ( | const T *const | p | ) | [inline] |
|
| Safe pointer manipulator. |
| Output operator for safe pointer. |
Variable Documentation
| Explicit conversion manipulator for DGD:channel. This manipulator has no effect on any channel. It is used to solve ambiguities between output operators for the same type. Here is brief scenario explaining what DGD::dgd is good for. Suppose you have an Int class. Suppose you already have output operator for this class:
std::ostream& operator <<( std::ostream& ostr, const Int& val ) {
...
}
Now for some reason you want Int to appear in your debug logs in hexa. The simplest way to accomplish this is to rewrite the output operator and put the following in: ...
if( dynamic_cast<DGD::channel*>(&ostr) != NULL ) {
... output debug stuff ...
} else {
... output usual stuff ...
}
...
This approach is good, but what if you do not want to change the output operator? The answer is simple - write output operator for DGD::channel: This approach has actually one weakness: The following code will actually call std::ostream's operator instead DGD::channel's one: Int a(0xFF);
channel debug(...);
debug << "a = " << a << ednl;
You are invited to guess why does this happen. Here comes DGD::dgd. debug << "a = " << DGD::dgd << a << endl;
It does not affect the stream, but explicitly returns reference to DGD::channel, thus ensuring the right operator call. |
Generated on Thu Aug 10 16:48:29 2006 for DGD Library by 1.3
|
|
|