Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

hex_ptr Class Reference
[Inserters]

#include <pantheios/inserters/hex_ptr.hpp>

Inheritance diagram for hex_ptr:

pointer

List of all members.


Detailed Description

[DEPRECATED] Class for inserting pointers into Pantheios diagnostic logging statements.

This class acts as a syntactic shorthand for the pantheios::pointer inserter class, by supplying the common width/format values in a defaulted constructor argument. Just as does pantheios::pointer, it converts a pointer variable into a string, thereby enabling it to be inserted into a logging statement.

Consider the following statement:

  void*       p   = reinterpret_cast<void*>(0x01234567);
  char        s[] = "abc";
  std::string str("def");

  pantheios::log(pantheios::notice, "s=", s, ", p=", pantheios::hex_ptr(p), ", str=", str);

On a 32-bit system, this will produce the output:

    s=abc, p=0x01234567, str=def

On a 64-bit system, this will produce the output:

    s=abc, p=0x0000000001234567, str=def

Deprecated:
This class is now obsolete, and will be removed from a future version of Pantheios; instead use the xp inserter
Examples:

cpp/inserters/example.cpp.inserter.hex_ptr/example.cpp.inserter.hex_ptr.cpp, cpp/inserters/example.cpp.inserter.p/example.cpp.inserter.p.cpp, cpp/inserters/example.cpp.inserter.pointer/example.cpp.inserter.pointer.cpp, and cpp/inserters/example.cpp.inserter.xp/example.cpp.inserter.xp.cpp.


Public Types

enum  { pointerHexWidth = sizeof(void*) * 2 }

Public Member Functions

 hex_ptr (void const volatile *p, int flags)
 [DEPRECATED] Construct from a pointer, with width/format specifier
 hex_ptr (void const volatile *p)
 Construct from a pointer, using the ambient pointer width and pantheios::fmt::fullHex format.
 hex_ptr (void const volatile *p, int minWidth, int format)
 Construct from a pointer, with width/format specifier.

Member Enumeration Documentation

anonymous enum

Enumerator:
pointerHexWidth  The maximum number of characters required to express any pointer value as a hex string


Constructor & Destructor Documentation

hex_ptr ( void const volatile *  p,
int  flags 
) [inline]

[DEPRECATED] Construct from a pointer, with width/format specifier

Parameters:
p The pointer whose value will be represented as a string
flags The width/format specifiers. Defaults to pointerHexWidth | pantheios::fmt::fullHex
Deprecated:
This constructor form is deprecated, and will be removed in a forthcoming release

hex_ptr ( void const volatile *  p  )  [inline, explicit]

Construct from a pointer, using the ambient pointer width and pantheios::fmt::fullHex format.

Parameters:
p The pointer whose value will be represented as a string

hex_ptr ( void const volatile *  p,
int  minWidth,
int  format 
) [inline]

Construct from a pointer, with width/format specifier.

Parameters:
p The pointer whose value will be represented as a string
minWidth The minimum width of the field. Must be in the range [-20, 20]
format Combination of format flags


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

pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 SourceForge.net Logo