summaryrefslogtreecommitdiffstats
path: root/ue4/mycpu/cdatset.h
blob: 03e71f4c63960e8b1827771600638237bb805324 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 * @module cdat
 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348)
 * @brief  Datatype template and datatype definition for CCPU and CMem
 * @date   26.05.2009
 */

#ifndef CDATSET_H
#define CDATSET_H 1

#include <boost/operators.hpp>
#include <iostream>

/**
 * @class CDat
 *
 * Datatype template for CCPU and CMem.
 */
template <class T>
class CDatSet
  : public CDat<T> 
{
  public:
    /**
     * @method operator>>
     * @brief  Shift/read operator for inputstream
     * @param  stream  reference to inputstream
     * @param  cdat    reference to object which will be read from stream
     * @return reference to inputstream
     * @globalvars none
     * @exception  none
     * @conditions none
     */
    friend std::istream& operator>>(std::istream & stream, CDatSet& cdat)
    {
      std::string s;
      stream >> s;
      cdat.m_value = s.size();
      return stream;
    }

  private:
    /* members */
    T m_value;
};

#endif

/* vim: set et sw=2 ts=2: */