MulAgg.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 namespace iv
4 {
5 
8 template< class Float >
9 class MulAgg
10 {
11 public:
12  MulAgg();
13  MulAgg( Float aggregated, int size );
14 
15  MulAgg< Float > Insert( Float value ) const;
16  MulAgg< Float > Remove( Float value ) const;
17 
18  Float Aggregated() const;
19  int Size() const;
20 
21 private:
22  Float current;
23  int count;
24 };
25 
28 template< class Float >
29 struct StringIO< MulAgg< Float > >
30 {
31  MulAgg< Float > Read( const char * source, Context const * context ) const
32  {
33  return MulAgg< Float >();
34  }
35 
36  std::string Write( MulAgg< Float > const & value, Context const * context ) const
37  {
38  return StringIO< Float >().Write( value.Aggregated(), context ) + std::string( "[mul of " ) + StringIO< int >().Write( value.Size(), context ) + std::string( "]" );
39  }
40 };
41 
42 }
43 
44 #include "MulAgg.inl"