Scopira 20080306

distflow.h

00001 
00002 /*
00003  *  Copyright (c) 2002    National Research Council
00004  *
00005  *  All rights reserved.
00006  *
00007  *  This material is confidential and proprietary information of
00008  *  National Research Council Canada ("Confidential Information").
00009  *  This Confidential Information may only be used and reproduced
00010  *  in accordance with the terms of the license agreement.
00011  *
00012  */
00013  
00014 #ifndef __INCLUDED_SCOPIRA_TOOL_DISTFLOW_H__
00015 #define __INCLUDED_SCOPIRA_TOOL_DISTFLOW_H__
00016 
00017 #include <vector>
00018 
00019 #include <scopira/tool/flow.h>
00020 
00021 namespace scopira
00022 {
00023   namespace tool
00024   {
00025     class teeoflow;
00026     class distoflow;
00027   }
00028 }
00029 
00036 class scopira::tool::teeoflow : public scopira::tool::oflow_i
00037 {
00038   protected:
00040     typedef scopira::tool::count2_ptr< scopira::tool::oflow_i > holder_t;
00041 
00042     holder_t dm_a, dm_b;    
00043 
00044   public:
00046     explicit teeoflow(bool doref);
00047 
00049     virtual bool failed(void) const;
00050 
00052     virtual size_t write(const byte_t* _buf, size_t _size);
00053 
00055     void set_flow_a(oflow_i* r);
00057     void set_flow_b(oflow_i* r);
00058 };
00059 
00065 class scopira::tool::distoflow : public scopira::tool::oflow_i
00066 {
00067   protected:
00069     typedef std::vector< scopira::tool::count2_ptr< scopira::tool::oflow_i > > oflowvec_t;
00070 
00071     oflowvec_t dm_flow;
00072     bool dm_doref;
00073 
00074   public:
00076     explicit distoflow(bool doref);
00077 
00079     virtual bool failed(void) const;
00080 
00082     virtual size_t write(const byte_t* _buf, size_t _size);
00083 
00084     void add_flow(oflow_i* r);
00085     void remove_flow(oflow_i* r);
00086     void clear_flow(void);
00087     bool contains_flow(const oflow_i* r) const;
00088     size_t size_flow(void) const;
00089 };
00090 
00091 #endif
00092