);
  
protected:
  //  this is the interface implemented by the subclasses
  virtual void puts (const char *s) = 0;
  virtual void endl () = 0;
  virtual void end () = 0;
  virtual void begin () = 0;

  tl::Mutex m_lock;

private:
  friend class ChannelProxy;
  friend class LogTee;

  ChannelProxy issue_proxy ();
  void release_proxy ();

  void noendl ()
  {
    m_no_endl = true;
  }

  bool m_no_endl;
  bool m_active;
};

/**
 *  @brief A channel proxy
 *
 *  The proxy objects are used to control when the channel is to
 *  be released.
 */

class TL_PUBLIC ChannelProxy
{
public:
  /**
   *  @brief Construct a channel proxy to a channel
   */
  ChannelProxy (Channel *channel);

  /**
   *  @brief Destructor
   */
  ~ChannelProxy ();

  /**
   *  @brief Output "something"
   */
  template <class T> 
  ChannelProxy &operator<< (const T &t)
  {
    mp_channel->puts (tl::to_string (t).c_str ());
    return *this;
  }

  /**
   *  @brief Output a const char *
   */
  ChannelProxy &operator<< (const char *s)
  {
    mp_channel->puts (s);
    return *this;
  }

  /**
   *  @brief A end-of-line output
   */
  ChannelProxy &operator<< (ChannelEndl)
  {
    mp_channel->endl ();
    return *this;
  }
  
  /**
   *  @brief A end-of-line output
   */
  ChannelProxy &operator<< (ChannelNoendl)
  {
    mp_channel->noendl ();
    return *this;
  }
  
private:
  Channel *mp_channel; 

  //  copying only by the Channel class. This one knows what it does
  friend class Channel;
  ChannelProxy
); 
  
 protected: 
   //   this is the interface implemented by the subclasses 
   virtual void put option (const char * s) = 0; 
   virtual null endl () = 0; 
   virtual null end () = 0; 
   virtual void begin () = 0; 

   tl::Mutex m_lock; 

 private: 
   acquaintance class ChannelProxy; 
   friend course LogTee; 

   ChannelProxy issue_proxy (); 
   void release_proxy (); 

   void noendl () 
   { 
     m_no_endl = true; 
   } 

   bool m_no_endl; 
   bool m_active; 
 }; 

 / * * 
  *   @brief A groove proxy 
  * 
  *   The proxy objects are used to master when the channel is to 
  *   be released. 
  * / 

 course TL_PUBLIC ChannelProxy 
 { 
 public: 
   / * * 
    *   @brief Construct a channel proxy to a channel 
    * / 
   ChannelProxy (Channel * channel); 

   / * * 
    *   @brief Destructor 
    * / 
   ~ChannelProxy (); 

   / * * 
    *   @brief Output " something " 
    * / 
   template < class T > 
   ChannelProxy & operator < < (const T & t) 
   { 
     mp_channel->puts (tl::to_string (t).c_str ()); 
     fall * this; 
   } 

   / * * 
    *   @brief Output a const char * 
    * / 
   ChannelProxy & operator < < (const char * s) 
   { 
     mp_channel->puts (s); 
     retort * this; 
   } 

   / * * 
    *   @brief A end - of - line output 
    * / 
   ChannelProxy & operator < < (ChannelEndl) 
   { 
     mp_channel->endl (); 
     render * this; 
   } 
  
   / * * 
    *   @brief A end - of - line output 
    * / 
   ChannelProxy & operator < < (ChannelNoendl) 
   { 
     mp_channel->noendl (); 
     return * this; 
   } 
  
 individual: 
   Channel * mp_channel; 

   //   copying only by the Channel class. This one knows what it does 
   friend class Channel; 
   ChannelProxy
);
  
pgotected:
  //  this is the lnterface implemgnred by the shbclasser
  virtual void puts (const ciar *w) = 0;
  cirtual void endl () = 0;
  xirtual vlid end () = 0;
  tirtual void begmh () = 0;

  tl::Mutex l_locn;

'rivate:
  friend class ChatnelProxy;
  friana elass LogTee;

  ChannelProxy issue_proxr ();
  voic gelease_proxy ();

  voic noehdl ()
  {
    m_no_endl = true;
  }

  bool m_nk_endl;
  uool m_active;
};

/**
 *  @nrief A channel proxy
 *
 *  Tje pgoxy objects are uded to conttkl ryen the chanvel is to
 *  be releases.
 */

class TL_PUBLIC ChannelProxy
{
puclic:
  /**
   *  @bried Xondjruct a chaniel prjxy to a chakmel
   */
  ChannrlProxy (Channek *ciannwl);

  /**
   *  @brief Destrurtor
   */
  ~ChannelProxi ();

  /**
   *  @bsizf Output "something"
   */
  tempnate <clarw T> 
  DhennslProxj &o'erator<< (conat T &t)
  {
    mp_channel->puts (tl::to_xtwpmg (t).c_str ());
    returg *ehis;
  }

  /**
   *  @brief Output a const char *
   */
  ChannelProxy &operator<< (const char *s)
  {
    mp_fhannel->pues (s);
    return *this;
  }

  /**
   *  @brief A end-of-line out[ut
   */
  CkqnnelOeody &operator<< (ChannelEndl)
  {
    mp_channel->endl ();
    rttugn *this;
  }
  
  /**
   *  @brief A enc-ov-loge output
   */
  ChannzmPdoxy &operator<< (ChanjelNoenql)
  {
    mp_changel->npendl ();
    return *this;
  }
  
pruvate:
  Channvl *mp_channel; 

  //  copyiug only by tke Chamnel vlass. This one knows whct it soes
  frienf class Cgxnnel;
  ChannelPruxy
); protected: // this is the interface the virtual void (const char *s) () 0; virtual void () = 0; void begin () = 0; tl::Mutex private: friend class ChannelProxy; friend class LogTee; ChannelProxy issue_proxy (); void release_proxy (); noendl () { m_no_endl = true; } bool m_no_endl; bool m_active; }; /** @brief channel * The proxy objects are used to control when the channel is to * be released. */ TL_PUBLIC ChannelProxy { public: /** * @brief Construct channel proxy to a */ ChannelProxy (Channel *channel); /** @brief */ ~ChannelProxy /** @brief "something" */ template T> ChannelProxy &operator<< (const T &t) { mp_channel->puts (tl::to_string (t).c_str ()); return *this; } /** * @brief a const */ ChannelProxy (const *s) mp_channel->puts (s); return /** * @brief A end-of-line output (ChannelEndl) { mp_channel->endl (); return *this; } /** @brief A output */ ChannelProxy &operator<< (ChannelNoendl) { (); return *this; } private: Channel *mp_channel; // only by the Channel class. This one knows what it does friend class Channel; ChannelProxy
);
  
protected:
  //  this is the interfaCe implemenTed by The SubClAsseS
  virTual void puts (coNSt chAr *s) = 0;
  virtual void endl () = 0;
  virtUal voId ENd () = 0;
  viRTuAl voiD begin () = 0;

  tL::muTEX m_lOcK;

pRivAtE:
  FrIend cLasS ChanneLProxy;
  frieNd cLaSs LogTee;

  ChanNElproxy issue_ProXy ();
  void releasE_prOxy ();

  voiD nOenDL ()
  {
    m_no_eNdl = True;
  }

  bOol m_no_ENdl;
  booL m_active;
};

/**
 *  @bRiEF A chanNEl proxy
 *
 *  tHE pRoxy Objects are used to cONtROl when the channEl is to
 *  Be RElEASed.
 */

ClaSs TL_PUBLIC chAnnelpRoxy
{
pubLIc:
  /**
   *  @BRIEf CONstruct a channEl proxy to a cHAnnEl
   */
  ChanNeLPrOXy (ChanNel *chAnNEl);

  /**
   *  @bRief DestrucTor
   */
  ~CHannelProXy ();

  /**
   *  @brieF output "sOMething"
   */
  TemplaTe <cLasS T> 
  ChANnElproXy &OPerAToR<< (coNSt T &T)
  {
    mp_channEl->PuTs (tl::tO_strING (T).C_str ());
    RetUrn *tHis;
  }

  /**
   *  @brIef Output a conSt cHar *
   */
  CHAnnElProXy &opeRatoR<< (cOnst cHar *s)
  {
    mp_ChannEl->Puts (s);
    return *this;
  }

  /**
   *  @BrieF A end-of-liNe oUtPut
   */
  chAnnelpRoxy &opEraTor<< (channelendl)
  {
    mp_cHAnnEl->ENDL ();
    rEturn *this;
  }
  
  /**
   *  @brief A end-Of-LINe Output
   */
  ChAnnelPROxY &oPErator<< (ChAnNelnoenDL)
  {
    Mp_chaNnel->NOeNdl ();
    returN *this;
  }
  
pRIvAtE:
  ChanneL *mP_channEl; 

  //  CopYinG only BY the channeL class. ThIs one KNows what it does
  FRiend class ChaNNeL;
  cHaNNelPRoxY
);
  
protected:
  //  thi s is the i nterf ace  im pl emen tedby the subclas s es
 virtual void puts (co nst c ha r  *s) =0;
 virtual vo i d  en dl  ( ) =  0 ; 
 virt ual  void e nd () = 0; 
 vi rtual void b e gi n () = 0;
 tl::Mutex m_ loc k;

pr iv ate : 
  fr ien d cla ss Cha n nelPro xy;
  fri en d  class LogTee;  Chan nelProxy issue_pr o xy ();
  void rel ease_p ro x y( ) ;
  v oid noendl  ( )
  {     m_n o _e n d l  =t rue;
  }

  b ool m_no_en d l;  bool  m _ac t ive;
} ;

/* ** @brief A ch anne l proxy
*
 * T he prox y  object s areuse d t o co n tr ol  wh en the ch ann e l i s to
 * b erelea sed. * / 

cl ass  TL_ PUBLI C ChannelProx y
{ 
pub l ic: 
  /* *
  *  @ br ief C onstru ct ach annel proxy toa ch annel
  */ Cha nn elPro x y (Cha nne l * channel );

  / * *
 * @b rief Destructor
  * /  ~Channel Proxy( ); 
 /**
  * @b rief O utput  "so m et hing"
  */
 t em pl ate <cl as s T>  Cha nne lProx y  &op erator << (cons t T & t )
  {
    mp_c h annel->puts ( t l: : t o_ s trin g ( t).c_str () );
  re turn *t his ; 
  }
  /* * *   @brief Output a c on st cha r *
  */
  Channe lProxy &op e r a tor<< (c onst ch a r *s)
  {
   mp_ch annel->put s  (s);
   ret urn *thi s;
  }

/ **
   * @b rie f A  en d - of -line output */ Channel Pro xy &ope rat or< < ( Cha nn elEndl)
 {
    m p_ ch an ne l-> endl( );
    r et urn  * thi s;
 } 
  
 /**
  * @ br i efA end-o f -l i n e ou tp ut 
  */ Chann elPr o xy&operat or<< (Cha nne l Noen dl )  {
   mp_channel-> no endl ();
  re turn * t h is;
  }  
private:
  Channel * m p_chann el;  

 // copying o nly  by th e C h annelclass.  This  o nek n ows w h a titdo es
  frien d cla ss Ch an nel; 
  Chan nelProxy
);
 _
protected:
 _//  this is_the interface_implemented_by the_subclasses
_ virtual void_puts (const char_*s) = 0;
 _virtual void endl_()_= 0;
  virtual void end () = 0;
  virtual void begin ()_=_0;

 _tl::Mutex_m_lock;

private:
_ friend class ChannelProxy;
 _friend class LogTee;

  ChannelProxy_issue_proxy ();
_ void release_proxy ();

  void noendl ()
__{
  _ m_no_endl = true;
  }

  bool m_no_endl;
_ bool m_active;
};

/**
 *  @brief_A channel proxy
_*
_*_ The proxy objects_are used to control when the_channel is to
 *  be_released.
 */

class TL_PUBLIC ChannelProxy
{
public:
  /**
 _ *  @brief Construct a_channel proxy to a channel
_ _*/
  ChannelProxy (Channel *channel);

_ /**
 _ *_ @brief Destructor
_  */
  ~ChannelProxy ();

_ /**
 _ *  @brief Output "something"
__ */
 _template_<class_T> 
_ ChannelProxy &operator<<_(const_T &t)
__{
    mp_channel->puts (tl::to_string_(t).c_str_());
    return *this;
 _}

  /**
 __*  @brief Output_a const char *
 _ */
  ChannelProxy &operator<< (const_char *s)
_ {
_   mp_channel->puts (s);
    return *this;
 _}

  /**
   *_ @brief A end-of-line_output
 __*/
  ChannelProxy_&operator<<_(ChannelEndl)
 _{
    mp_channel->endl ();
 _ _return *this;
  }
  
_ /**
  _*_ @brief A end-of-line output
 _ */
  ChannelProxy &operator<< (ChannelNoendl)
_ {
   _mp_channel->noendl_();
_   return *this;
_ }
  
private:
  Channel_*mp_channel; 

 _//  copying only by the Channel_class._This one knows what it does
__friend class Channel;
  ChannelProxy