YPC  0.2.0
data_source.h
1 #pragma once
2 #include "hpda/extractor/extractor_base.h"
3 #include "ypc/common/limits.h"
4 #include "ypc/core_t/ecommon/package.h"
5 #include "ypc/corecommon/data_source.h"
6 #include "ypc/stbox/ebyte.h"
7 #include "ypc/stbox/stx_common.h"
8 #include "ypc/stbox/tsgx/channel/dh_session_initiator.h"
9 #include <ff/util/ntobject.h>
10 
11 namespace ypc {
12 using bytes = ::stbox::bytes;
13 typedef ::ff::util::ntobject<nt<bytes>::data> data_source_output_t;
14 
15 class data_source_with_dhash : public data_source<bytes> {
16 public:
17  inline data_source_with_dhash(const stbox::bytes &data_hash)
18  : m_expect_data_hash(data_hash) {}
19 
20  virtual ~data_source_with_dhash() {}
21 
22  inline const bytes &expect_data_hash() const { return m_expect_data_hash; }
23  virtual const bytes &data_hash() const = 0;
24 
25  inline void reset_reach_end(){m_data_reach_end = false;}
26 
27 protected:
28  bytes m_expect_data_hash;
29  bool m_data_reach_end;
30  uint32_t m_counter;
31 };
32 } // namespace ypc
ypc::data_source_with_dhash
Definition: data_source.h:15
ypc::data_source
Definition: data_source.h:8
ypc::utc::bytes< byte_t, ::ypc::utc::byte_encode::raw_bytes >