/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* $Id: cmnOutputMultiplexer.cpp,v 1.10 2007/04/26 19:33:56 anton Exp $ Author(s): Ofri Sadowsky Created on: 2002-04-18 (C) Copyright 2002-2007 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- This software is provided "as is" under an open source license, with no warranty. The complete license can be found in license.txt and http://www.cisst.org/cisst/license.txt. --- end cisst license --- */ #include #include #include // Add an output channel. See notes above. // Parameters: // channel - a pointer to the output channel to be added. // // Return value: *this std::ostream & cmnOutputMultiplexer::AddChannel(ChannelType * channel) { ChannelContainerType::iterator it = std::find(m_ChannelContainer.begin(), m_ChannelContainer.end(), channel); if (it == m_ChannelContainer.end()) { m_ChannelContainer.insert(it, channel); m_Streambuf.AddChannel( channel->rdbuf(), 0 ); } return (*this); } // Remove an output channel. // Parameters: // channel - a pointer to the output channel to be removed. No change occurs if // the pointer is not on the list of channels for this multiplexer // // Return value: *this std::ostream & cmnOutputMultiplexer::RemoveChannel(ChannelType * channel) { m_ChannelContainer.remove(channel); m_Streambuf.RemoveChannel( channel->rdbuf() ); return (*this); } // **************************************************************************** // Change History // **************************************************************************** // // $Log: cmnOutputMultiplexer.cpp,v $ // Revision 1.10 2007/04/26 19:33:56 anton // All files in libraries: Applied new license text, separate copyright and // updated dates, added standard header where missing. // // Revision 1.9 2006/11/20 20:33:19 anton // Licensing: Applied new license to cisstCommon, cisstVector, cisstNumerical, // cisstInteractive, cisstImage and cisstOSAbstraction. // // Revision 1.8 2005/09/26 15:41:46 anton // cisst: Added modelines for emacs and vi. // // Revision 1.7 2005/05/19 19:29:01 anton // cisst libs: Added the license to cisstCommon and cisstVector // // Revision 1.6 2004/10/09 18:52:49 ofri // Some cleanup in cisstCommon header files. gcc on cygwin prints a bunch of // warnings when it encounters #pragma warning . Some files had that prama used // if WIN32 is defined, which is the case with cygwin/gcc. I substituted that with // including cmnPortability and adding the warning disable that. // // Revision 1.5 2004/08/20 20:09:21 anton // cisstCommon: Corrected bug introduced by [709] (find requires std::find) // // Revision 1.4 2004/08/19 21:04:02 anton // cmnOutputMultiplexer: Removed using namespace std. // // Revision 1.3 2003/09/09 18:50:14 anton // changed from double quotes to <> for all #include // // Revision 1.2 2003/06/23 20:53:51 anton // removed tabs // // Revision 1.1.1.1 2003/05/30 19:47:56 anton // no message // // // ****************************************************************************