DGD Library
Version: 0.1.0.14 | Updated: Thu Aug 10 16:59:15 2006
Home
DGD News
FAQ
Code Documentation
DGD Installation Guide
Bugs-n-Features
DGD at Sourceforge.net
Download DGD
Subversion
Code Documentation
Documentation
Namespaces
Class Hierarchy
Class List
File List
Namespace Members
Functions
Globals
Tutorial
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

Variables


Detailed Description

Depression Glass namespace.

Typedef Documentation

typedef channel_manip<bool> DGD::channel_manip_bool
 

Alias for channel_manip<bool>.

typedef channel_manip<unsigned int> DGD::channel_manip_uint
 

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

enum DGD::Assoc_type
 

Enumeration values:
Assoc_Append 
Assoc_Assign 
Assoc_Prepend 
Assoc_Delete 


Function Documentation

void DGD::assoc std::ostream * s,
channelchannel,
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,
channelcnl,
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*)

std::ostream& operator<< std::ostream & cnl,
const channel_manip_voidmanip
[inline]
 

Apply channel_manip_void on channel.

std::ostream& operator<< std::ostream & cnl,
const channel_manip_boolmanip
[inline]
 

Apply channel_manip_bool on channel.

std::ostream& operator<< std::ostream & cnl,
const channel_manip_uintmanip
[inline]
 

Apply channel_manip_unit on channel.

channel& operator<< std::ostream & cnl,
const channel_manip_nopmanip
[inline]
 

std::ostream to DGD::channel convertor.

This output operator does not change the stream. It performs static casting from std::ostream and returns the corresponding DGD::channel.

See also:
DGD::dgd

DGD::channel_manip_nop

channel_manip_uint step unsigned int s )  [inline]
 

Change indentation step manipulator.

See also:
DGD::channel::indent_step(unsigned int)

channel_manip_uint indent unsigned int s )  [inline]
 

Change indentation level manipulator.

See also:
DGD::channel::indent(unsigned int)

channel_manip_uint minwidth unsigned int s )  [inline]
 

Change minimum line width manipulator.

See also:
DGD::channel::min_width(unsigned int)

channel_manip_uint maxwidth unsigned int s )  [inline]
 

Change maximum line width manipulator.

See also:
DGD::channel::max_width(unsigned int)

channel_manip_bool wrap bool s )  [inline]
 

Enable/disable character wrapping manipulator.

See also:
DGD::channel::wrap(bool)

channel_manip_bool word_wrap bool s )  [inline]
 

Enable/disable word wrapping manipulator.

See also:
DGD::channel::word_wrap(bool)

template<class First_type, class Second_type>
channel& operator<< channelcnl,
const std::pair< First_type, Second_type > & p
[inline]
 

Pair output operator.

Will print a pair in a form "[first second]"

template<>
channel& operator<< channelcnl,
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<< channelcnl,
const std::list< Item_type > & l
[inline]
 

List output operator.

Prints list in form:

 {
    item1
    item2
    ...
 }

template<class Item_type>
channel& operator<< channelcnl,
const std::vector< Item_type > & v
[inline]
 

Vector output operator.

Prints vector in form:

 {
    item1
    item2
    ...
 }

template<class Key_type, class Value_type>
channel& operator<< channelcnl,
const std::map< Key_type, Value_type > & m
[inline]
 

Map output operator.

Prints map in form:

 {
    item1
    item2
    ...
 }
Order of elements is defined by std::map<...>::iterator

template<class InputIter>
channel& dgd_copy InputIter begin,
InputIter end,
channelch,
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,
channelch,
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 Iterator>
channel& operator<< channelcnl,
const dgd_sequence< Iterator > & seq
[inline]
 

Output operator for DGD::dgd_sequence.

template<class Circulator>
channel& operator<< channelcnl,
const dgd_circle< Circulator > & circle
[inline]
 

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
[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.

template<class T>
channel& operator<< channelcnl,
const dgd_safe_ptr< T > & ptr
[inline]
 

Output operator for safe pointer.


Variable Documentation

const channel_manip_void DGD::incr = channel_manip_void( &channel::incr_indent )
 

Indentation increment manipulator for DGD:channel.

See also:
DGD::channel::incr_indent()

const channel_manip_void DGD::decr = channel_manip_void( &channel::decr_indent )
 

Indentation decrement manipulator for DGD:channel.

See also:
DGD::channel::decr_indent()

const channel_manip_nop DGD::dgd = channel_manip_nop()
 

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:
 DGD::channel& operator << ( DGD::channel& cnl, const Int& val ) {
 ... 
 }
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; // This will print 256 instead of FF
You are invited to guess why does this happen. Here comes DGD::dgd.
 debug << "a = " << DGD::dgd << a << endl; // works well!
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 doxygen1.3

SourceForge.net Logo Powered by Mason Powered by Perl
Web design derived from Pasilda design found on www.oswd.org.
Copyright (c) 2002, 2003. Dimitry Kloper <kloper@users.sourceforge.net>