CatapultServer  v0.5.0.1 (Elephant)
WorkingBuffer.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "AppendContext.h"
23 #include "IoTypes.h"
24 #include "PacketExtractor.h"
25 #include "PacketSocketOptions.h"
26 
27 namespace catapult { namespace ionet {
28 
30  class WorkingBuffer {
31  public:
33  explicit WorkingBuffer(const PacketSocketOptions& options);
34 
35  public:
37  inline auto begin() const {
38  return m_data.cbegin();
39  }
40 
42  inline auto end() const {
43  return m_data.cend();
44  }
45 
47  inline auto size() const {
48  return m_data.size();
49  }
50 
52  inline auto data() const {
53  return m_data.data();
54  }
55 
57  inline auto capacity() const {
58  return m_data.capacity();
59  }
60 
61  public:
64 
67 
68  private:
69  void checkMemoryUsage();
70 
71  private:
75  size_t m_maxDataSize;
76  };
77 }}
colorama.winterm.WinTerm.back
def back(self, back=None, light=False, on_stderr=False)
Definition: winterm.py:59
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
CATAPULT_VERSION
#define CATAPULT_VERSION
Definition: version.h:37
AppendContext.h
colorama.winterm.WinTerm.get_attrs
def get_attrs(self)
Definition: winterm.py:36
colorama.winterm.WinTerm.reset_all
def reset_all(self, on_stderr=None)
Definition: winterm.py:44
catapult::ionet::WorkingBuffer::data
auto data() const
Returns a const pointer to the raw buffer.
Definition: WorkingBuffer.h:52
colorama.win32.SetConsoleTitle
def SetConsoleTitle(title)
Definition: win32.py:153
Parser.debug
def debug(*args)
Definition: Parser.py:46
colorama.winterm.WinTerm._light
_light
Definition: winterm.py:34
catapult::ionet::PacketSocketOptions::WorkingBufferSensitivity
size_t WorkingBufferSensitivity
Working buffer sensitivity.
Definition: PacketSocketOptions.h:32
colorama.winterm.WinTerm.__init__
def __init__(self)
Definition: winterm.py:24
CATAPULT_COPYRIGHT
#define CATAPULT_COPYRIGHT
Definition: version.h:40
PacketSocketOptions.h
colorama.winterm.WinTerm.style
def style(self, style=None, on_stderr=False)
Definition: winterm.py:70
colorama.win32._FillConsoleOutputAttribute
_FillConsoleOutputAttribute
Definition: win32.py:76
colorama.win32.FillConsoleOutputCharacter
def FillConsoleOutputCharacter(stream_id, char, length, start)
Definition: win32.py:133
version.h
colorama.winterm.WinTerm._style
_style
Definition: winterm.py:42
colorama.win32.GetConsoleScreenBufferInfo
def GetConsoleScreenBufferInfo(stream_id=STDOUT)
Definition: win32.py:104
colorama.winterm.WinTerm._default_back
_default_back
Definition: winterm.py:28
colorama.win32.CONSOLE_SCREEN_BUFFER_INFO.__str__
def __str__(self)
Definition: win32.py:30
catapult::ionet::WorkingBuffer::size
auto size() const
Returns the size of the buffer.
Definition: WorkingBuffer.h:47
colorama.winterm.WinTerm._default_fore
_default_fore
Definition: winterm.py:27
colorama.win32._SetConsoleCursorPosition
_SetConsoleCursorPosition
Definition: win32.py:59
colorama.winterm.WinTerm.cursor_adjust
def cursor_adjust(self, x, y, on_stderr=False)
Definition: winterm.py:102
colorama.winterm.WinTerm._back
_back
Definition: winterm.py:41
catapult::ionet::WorkingBuffer::m_options
PacketSocketOptions m_options
Definition: WorkingBuffer.h:72
colorama.win32._GetConsoleScreenBufferInfo
_GetConsoleScreenBufferInfo
Definition: win32.py:45
colorama.winterm.WinTerm.set_attrs
def set_attrs(self, value)
Definition: winterm.py:39
catapult::ionet::WorkingBuffer::capacity
auto capacity() const
Returns the capacity of the raw buffer.
Definition: WorkingBuffer.h:57
colorama.win32._GetStdHandle
_GetStdHandle
Definition: win32.py:39
PacketExtractor.h
colorama.winterm.WinTerm.erase_screen
def erase_screen(self, mode=0, on_stderr=False)
Definition: winterm.py:110
catapult::ionet::ByteBuffer
std::vector< uint8_t > ByteBuffer
Definition: IoTypes.h:28
colorama.winterm.WinColor
Definition: winterm.py:6
catapult::ionet::WorkingBuffer::WorkingBuffer
WorkingBuffer(const PacketSocketOptions &options)
Creates an empty working buffer around options.
Definition: WorkingBuffer.cpp:25
catapult::ionet::WorkingBuffer::checkMemoryUsage
void checkMemoryUsage()
Definition: WorkingBuffer.cpp:42
colorama.win32._SetConsoleTextAttribute
_SetConsoleTextAttribute
Definition: win32.py:52
colorama.winterm.WinTerm._default
_default
Definition: winterm.py:25
colorama.winterm.WinTerm._default_style
_default_style
Definition: winterm.py:29
colorama.winterm.WinTerm.get_position
def get_position(self, handle)
Definition: winterm.py:84
catapult::ionet::PacketSocketOptions::MaxPacketDataSize
size_t MaxPacketDataSize
Maximum packet data size.
Definition: PacketSocketOptions.h:35
catapult::ionet::WorkingBuffer::begin
auto begin() const
Returns a const iterator to the beginning of the buffer.
Definition: WorkingBuffer.h:37
catapult::ionet::WorkingBuffer::m_numDataSizeSamples
size_t m_numDataSizeSamples
Definition: WorkingBuffer.h:74
colorama.win32.FillConsoleOutputAttribute
def FillConsoleOutputAttribute(stream_id, attr, length, start)
Definition: win32.py:143
WorkingBuffer.h
catapult::ionet::WorkingBuffer::prepareAppend
AppendContext prepareAppend()
Creates an append context that can be used to append data to the working buffer.
Definition: WorkingBuffer.cpp:32
colorama.win32._FillConsoleOutputCharacterA
_FillConsoleOutputCharacterA
Definition: win32.py:66
colorama.win32.SetConsoleTextAttribute
SetConsoleTextAttribute
Definition: win32.py:14
colorama.winterm.WinTerm.set_cursor_position
def set_cursor_position(self, position=None, on_stderr=False)
Definition: winterm.py:92
colorama.win32.SetConsoleCursorPosition
def SetConsoleCursorPosition(stream_id, position, adjust=True)
Definition: win32.py:115
catapult::ionet::WorkingBuffer::preparePacketExtractor
PacketExtractor preparePacketExtractor()
Creates a packet extractor that can be used to extract packets from the working buffer.
Definition: WorkingBuffer.cpp:38
colorama.win32.COORD
COORD
Definition: win32.py:19
colorama.winterm.WinTerm.fore
def fore(self, fore=None, light=False, on_stderr=False)
Definition: winterm.py:48
m_options
CompareChainsOptions m_options
Definition: CompareChains.cpp:165
colorama.winterm.WinTerm.set_console
def set_console(self, attrs=None, on_stderr=False)
Definition: winterm.py:76
colorama.win32.CONSOLE_SCREEN_BUFFER_INFO
Definition: win32.py:21
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::ionet::PacketSocketOptions
Packet socket options.
Definition: PacketSocketOptions.h:27
colorama.winterm.WinTerm._fore
_fore
Definition: winterm.py:40
catapult::ionet::WorkingBuffer::m_data
ByteBuffer m_data
Definition: WorkingBuffer.h:73
catapult::ionet::WorkingBuffer::m_maxDataSize
size_t m_maxDataSize
Definition: WorkingBuffer.h:75
colorama.winterm.WinTerm.erase_line
def erase_line(self, mode=0, on_stderr=False)
Definition: winterm.py:139
colorama.win32.winapi_test
winapi_test
Definition: win32.py:15
catapult::ionet::PacketExtractor
Helper for extracting a packet from a working buffer.
Definition: PacketExtractor.h:49
catapult::ionet::WorkingBuffer::end
auto end() const
Returns a const iterator to the end of the buffer.
Definition: WorkingBuffer.h:42
catapult::ionet::AppendContext
Definition: AppendContext.h:28
catapult::ionet::PacketSocketOptions::WorkingBufferSize
size_t WorkingBufferSize
Initial working buffer size.
Definition: PacketSocketOptions.h:29
colorama.winterm.WinTerm
Definition: winterm.py:22
catapult::ionet::WorkingBuffer
A buffer for storing working data.
Definition: WorkingBuffer.h:30
colorama.winterm.WinStyle
Definition: winterm.py:17
colorama.win32._SetConsoleTitleW
_SetConsoleTitleW
Definition: win32.py:86
IoTypes.h
colorama.winterm.WinTerm.set_title
def set_title(self, title)
Definition: winterm.py:161