lestes::msg::message_stencil2< P0, P1 > Class Template Reference

Message stencil. More...

#include <message_stencil.hh>

Inheritance diagram for lestes::msg::message_stencil2< P0, P1 >:

lestes::msg::message_stencil lestes::std::object lestes::std::mem::keystone List of all members.

Public Types

typedef formatter< P0 > f0_type
 The type of formatter for zeroth parameter.
typedef formatter< P1 > f1_type
 The type of formatter for first parameter.

Public Member Functions

ptr< messageformat (const P0 &p0, const P1 &p1) const
 Formats a message according to the stencil.

Static Public Member Functions

static ptr< message_stencil2<
P0, P1 > > 
create (const lstring &a_format, flags_type a_flags, const ptr< f0_type > &a_f0, const ptr< f1_type > &a_f1)
 Returns new stencil.

Protected Member Functions

 message_stencil2 (const lstring &a_format, flags_type a_flags, const ptr< f0_type > &a_f0, const ptr< f1_type > &a_f1)
 Creates new stencil.
void gc_mark (void)
 Marks the object.

Private Member Functions

 message_stencil2 (const message_stencil2< P0, P1 > &)
 Hides copy constructor.
message_stencil2< P0, P1 > & operator= (const message_stencil2< P0, P1 > &)
 Hides assignment operator.

Private Attributes

srp< f0_typef0
 The formatter for the zeroth parameter.
srp< f1_typef1
 The formatter for the first parameter.

Detailed Description

template<typename P0, typename P1>
class lestes::msg::message_stencil2< P0, P1 >

Message stencil.

Represents message stencil with two formatted parameter.

Parameters:
P0 The type of the zeroth parameter.
P1 The type of the first parameter.

Definition at line 275 of file message_stencil.hh.


Member Typedef Documentation

template<typename P0, typename P1>
typedef formatter<P0> lestes::msg::message_stencil2< P0, P1 >::f0_type

The type of formatter for zeroth parameter.

Definition at line 278 of file message_stencil.hh.

template<typename P0, typename P1>
typedef formatter<P1> lestes::msg::message_stencil2< P0, P1 >::f1_type

The type of formatter for first parameter.

Definition at line 280 of file message_stencil.hh.


Constructor & Destructor Documentation

template<typename P0, typename P1>
lestes::msg::message_stencil2< P0, P1 >::message_stencil2 ( const lstring &  a_text,
flags_type  a_flags,
const ptr< f0_type > &  a_f0,
const ptr< f1_type > &  a_f1 
) [inline, protected]

Creates new stencil.

Creates the stencil.

Parameters:
a_format The message format.
a_flags The message flags.
a_f0 The formatter for the zeroth parameter.
a_f1 The formatter for the first parameter.

Definition at line 322 of file message_stencil.hh.

Referenced by lestes::msg::message_stencil2< P0, P1 >::create().

00323                                                                    :
00324         message_stencil(2,a_text,a_flags),
00325         f0(checked(a_f0)),
00326         f1(checked(a_f1))
00327 {
00328 }

template<typename P0, typename P1>
lestes::msg::message_stencil2< P0, P1 >::message_stencil2 ( const message_stencil2< P0, P1 > &   )  [private]

Hides copy constructor.


Member Function Documentation

template<typename P0, typename P1>
ptr< message > lestes::msg::message_stencil2< P0, P1 >::format ( const P0 &  p0,
const P1 &  p1 
) const [inline]

Formats a message according to the stencil.

Formats a messge from the stencil.

Parameters:
p0 The zeroth argument to format.
p1 The first argument to format.
Returns:
The formatted message.

Definition at line 337 of file message_stencil.hh.

References lestes::std::vector< T >::create(), lestes::msg::message_stencil2< P0, P1 >::f0, lestes::msg::message_stencil2< P0, P1 >::f1, and lestes::msg::message_stencil::generate().

00338 {
00339         ptr<args_type> args = args_type::create();
00340         args->push_back(f0->format(p0));
00341         args->push_back(f1->format(p1));
00342         return generate(args);
00343 }

template<typename P0, typename P1>
ptr< message_stencil2< P0, P1 > > lestes::msg::message_stencil2< P0, P1 >::create ( const lstring &  a_format,
flags_type  a_flags,
const ptr< f0_type > &  a_f0,
const ptr< f1_type > &  a_f1 
) [inline, static]

Returns new stencil.

Returns the two-parameter stencil, initializes with values to fill into the message.

Precondition:
The format string is well-formed.

a_f0 != NULL

a_f1 != NULL

Parameters:
a_format The format for the message, with % designating indexed parameter slots.
a_flags The flags for the message.
a_f0 The formatter for the zeroth parameter.
a_f1 The formatter for the first parameter.
Returns:
The stencil with given values.

Definition at line 357 of file message_stencil.hh.

References lestes::msg::message_stencil2< P0, P1 >::message_stencil2().

00359 {
00360         return new message_stencil2(a_format,a_flags,a_f0,a_f1);
00361 }

template<typename P0, typename P1>
void lestes::msg::message_stencil2< P0, P1 >::gc_mark ( void   )  [inline, protected, virtual]

Marks the object.

Marks the object for garbage collection.

Reimplemented from lestes::msg::message_stencil.

Definition at line 307 of file message_stencil.hh.

References lestes::msg::message_stencil2< P0, P1 >::f0, lestes::msg::message_stencil2< P0, P1 >::f1, and lestes::msg::message_stencil::gc_mark().

00308 {
00309         f0.gc_mark();
00310         f1.gc_mark();
00311         message_stencil::gc_mark();
00312 }

template<typename P0, typename P1>
message_stencil2<P0,P1>& lestes::msg::message_stencil2< P0, P1 >::operator= ( const message_stencil2< P0, P1 > &   )  [private]

Hides assignment operator.


Member Data Documentation

template<typename P0, typename P1>
srp<f0_type> lestes::msg::message_stencil2< P0, P1 >::f0 [private]

The formatter for the zeroth parameter.

Definition at line 294 of file message_stencil.hh.

Referenced by lestes::msg::message_stencil2< P0, P1 >::format(), and lestes::msg::message_stencil2< P0, P1 >::gc_mark().

template<typename P0, typename P1>
srp<f1_type> lestes::msg::message_stencil2< P0, P1 >::f1 [private]

The formatter for the first parameter.

Definition at line 296 of file message_stencil.hh.

Referenced by lestes::msg::message_stencil2< P0, P1 >::format(), and lestes::msg::message_stencil2< P0, P1 >::gc_mark().


The documentation for this class was generated from the following file:
Generated on Mon Feb 12 18:25:54 2007 for lestes by doxygen 1.5.1-20070107