Scopira  20080306
distflow.h
1 
2 /*
3  * Copyright (c) 2002 National Research Council
4  *
5  * All rights reserved.
6  *
7  * This material is confidential and proprietary information of
8  * National Research Council Canada ("Confidential Information").
9  * This Confidential Information may only be used and reproduced
10  * in accordance with the terms of the license agreement.
11  *
12  */
13 
14 #ifndef __INCLUDED_SCOPIRA_TOOL_DISTFLOW_H__
15 #define __INCLUDED_SCOPIRA_TOOL_DISTFLOW_H__
16 
17 #include <vector>
18 
19 #include <scopira/tool/flow.h>
20 
21 namespace scopira
22 {
23  namespace tool
24  {
25  class teeoflow;
26  class distoflow;
27  }
28 }
29 
37 {
38  protected:
41 
42  holder_t dm_a, dm_b;
43 
44  public:
46  explicit teeoflow(bool doref);
47 
49  virtual bool failed(void) const;
50 
52  virtual size_t write(const byte_t* _buf, size_t _size);
53 
55  void set_flow_a(oflow_i* r);
57  void set_flow_b(oflow_i* r);
58 };
59 
66 {
67  protected:
69  typedef std::vector< scopira::tool::count2_ptr< scopira::tool::oflow_i > > oflowvec_t;
70 
71  oflowvec_t dm_flow;
72  bool dm_doref;
73 
74  public:
76  explicit distoflow(bool doref);
77 
79  virtual bool failed(void) const;
80 
82  virtual size_t write(const byte_t* _buf, size_t _size);
83 
84  void add_flow(oflow_i* r);
85  void remove_flow(oflow_i* r);
86  void clear_flow(void);
87  bool contains_flow(const oflow_i* r) const;
88  size_t size_flow(void) const;
89 };
90 
91 #endif
92 
scopira::tool::byte_t byte_t
Definition: flow.h:73
void set_flow_a(oflow_i *r)
sets the A (first) flow. may be null
Definition: distflow.h:65
Definition: archiveflow.h:20
virtual size_t write(const byte_t *_buf, size_t _size)
write a raw block of data
virtual bool failed(void) const
are we in a failed state?
scopira::tool::count2_ptr< scopira::tool::oflow_i > holder_t
output links
Definition: distflow.h:40
teeoflow(bool doref)
the two flows
std::vector< scopira::tool::count2_ptr< scopira::tool::oflow_i > > oflowvec_t
output links
Definition: distflow.h:69
Definition: distflow.h:36
void set_flow_b(oflow_i *r)
sets the B (first) flow. may be null
Definition: flow.h:159