Inform Class Reference

A message is sent to an Inform object by treating it as an ostream, then ending the message by sending the 'inform' manipulator. More...

#include <Inform.h>

Collaboration diagram for Inform:

Collaboration graph
[legend]

List of all members.

Public Types

enum  { out, app }
enum  { allContexts = (-1) }
enum  { off = (-1), on = 0 }
typedef int ID_t
typedef int Level_t
typedef int Context_t
typedef std::ios_base::fmtflags FmtFlags_t

Public Member Functions

 Inform (const char *prefix=0, Context_t outputContext=0)
 Inform (const char *prefix, const char *fname, int writemode, Context_t outputContext=0)
 Inform (const char *prefix, std::ostream &outstream, Context_t outputContext=0)
 ~Inform ()
const std::string & prefix () const
void setPrefix (const char *prefix=0)
ID_t open (Context_t context=0)
ID_t open (const char *fname, int writemode, Context_t context=0)
ID_t open (std::ostream &outstream, Context_t context=0)
void close (ID_t)
void close ()
Level_t messageLevel () const
InformsetMessageLevel (Level_t newval)
Level_t outputLevel (ID_t id=0) const
void setOutputLevel (Level_t newval, ID_t id)
void setOutputLevel (Level_t newval)
Context_t outputContext (ID_t id=0) const
void setOutputContext (Context_t outputContext, ID_t id)
void setOutputContext (Context_t outputContext)
void flush ()
void print ()
void output ()
std::ostream & stream ()
FmtFlags_t setf (FmtFlags_t setbits, FmtFlags_t field)
FmtFlags_t setf (FmtFlags_t f)
void unsetf (FmtFlags_t f)
long flags () const
long flags (FmtFlags_t f)
int width () const
int width (int w)
char fill () const
char fill (char c)
int precision () const
int precision (int p)
void lock () const
void unlock () const

Static Public Member Functions

static Context_t context ()
static Context_t numContexts ()
static void setContext (Context_t c)
static void setNumContexts (Context_t n)


Detailed Description

A message is sent to an Inform object by treating it as an ostream, then ending the message by sending the 'inform' manipulator.

In fact, Inform works much like an ostream, although it may actually just use stdio for I/O.

Each message is assigned the current 'level of interest'; the lower the level, the more important it is. Each Inform object is also set for a current level; messages with a level <= the current level are displayed. Level values >= 0 should be used to print values; setting the output threshhold level to be < 0 will turn off printing of all messages.

By default, a new Inform object will only print out the message on context 0. You may change the node on which this prints with the 'printContext(int)' method; if the argument is 'allContexts', the message will be printed on ALL nodes, not just one. Or, 'printAllContexts()' can be used instead. The final argument to the constructor may also be set to the context to print on.


Member Typedef Documentation

typedef int Inform::ID_t

typedef int Inform::Level_t

typedef int Inform::Context_t

typedef std::ios_base::fmtflags Inform::FmtFlags_t


Member Enumeration Documentation

anonymous enum

Enumerator:
out 
app 

anonymous enum

Enumerator:
allContexts 

anonymous enum

Enumerator:
off 
on 


Constructor & Destructor Documentation

Inform::Inform ( const char *  prefix = 0,
Context_t  outputContext = 0 
)

Inform::Inform ( const char *  prefix,
const char *  fname,
int  writemode,
Context_t  outputContext = 0 
)

Inform::Inform ( const char *  prefix,
std::ostream &  outstream,
Context_t  outputContext = 0 
)

Inform::~Inform (  ) 


Member Function Documentation

const std::string& Inform::prefix (  )  const [inline]

void Inform::setPrefix ( const char *  prefix = 0  ) 

ID_t Inform::open ( Context_t  context = 0  ) 

ID_t Inform::open ( const char *  fname,
int  writemode,
Context_t  context = 0 
)

ID_t Inform::open ( std::ostream &  outstream,
Context_t  context = 0 
)

void Inform::close ( ID_t   ) 

void Inform::close (  ) 

Level_t Inform::messageLevel (  )  const [inline]

Inform& Inform::setMessageLevel ( Level_t  newval  )  [inline]

Level_t Inform::outputLevel ( ID_t  id = 0  )  const

void Inform::setOutputLevel ( Level_t  newval,
ID_t  id 
)

void Inform::setOutputLevel ( Level_t  newval  ) 

Context_t Inform::outputContext ( ID_t  id = 0  )  const

void Inform::setOutputContext ( Context_t  outputContext,
ID_t  id 
)

void Inform::setOutputContext ( Context_t  outputContext  ) 

static Context_t Inform::context (  )  [inline, static]

static Context_t Inform::numContexts (  )  [inline, static]

static void Inform::setContext ( Context_t  c  )  [inline, static]

static void Inform::setNumContexts ( Context_t  n  )  [inline, static]

void Inform::flush (  ) 

Referenced by output(), and print().

void Inform::print (  )  [inline]

void Inform::output (  )  [inline]

References flush().

std::ostream& Inform::stream (  )  [inline]

Referenced by operator<<().

FmtFlags_t Inform::setf ( FmtFlags_t  setbits,
FmtFlags_t  field 
) [inline]

Referenced by operator<<().

FmtFlags_t Inform::setf ( FmtFlags_t  f  )  [inline]

void Inform::unsetf ( FmtFlags_t  f  )  [inline]

long Inform::flags (  )  const [inline]

long Inform::flags ( FmtFlags_t  f  )  [inline]

int Inform::width (  )  const [inline]

int Inform::width ( int  w  )  [inline]

char Inform::fill (  )  const [inline]

char Inform::fill ( char  c  )  [inline]

int Inform::precision (  )  const [inline]

int Inform::precision ( int  p  )  [inline]

void Inform::lock (  )  const [inline]

void Inform::unlock (  )  const [inline]


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

Generated on Wed Mar 16 06:20:14 2011 for FreePOOMA by  doxygen 1.5.9