0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Private Attributes | List of all members
Hypertable::SshOutputCollector Class Reference

Collects buffers of output from execution of remote SSH command. More...

#include <SshOutputCollector.h>

Collaboration diagram for Hypertable::SshOutputCollector:
Collaboration graph
[legend]

Classes

class  Buffer
 Fixed-size buffer to hold a portion of output. More...
 
class  iterator
 Iterator for traversing output line-by-line. More...
 

Public Member Functions

 SshOutputCollector (size_t buffer_size)
 Constructor. More...
 
size_t buffer_size ()
 Returns buffer size. More...
 
Buffer allocate_buffer ()
 Allocate a buffer. More...
 
void add (Buffer buf)
 Adds filled buffer to collector. More...
 
bool empty () const
 Returns true if no output has been collected Returns true if there are no collected buffers or if none of the collected buffers contain data. More...
 
bool last_line_is_partial ()
 Returns true if last line collected is partial. More...
 
iterator begin ()
 Returns iterator at beginning of output collector. More...
 
iterator end ()
 Returns iterator at end of output collector. More...
 

Private Attributes

size_t m_buffer_size {}
 Buffer size More...
 
CharArena m_arena
 Character arena from which buffers are allocated. More...
 
std::vector< Bufferm_buffers
 Vector of buffers. More...
 

Detailed Description

Collects buffers of output from execution of remote SSH command.

Definition at line 47 of file SshOutputCollector.h.

Constructor & Destructor Documentation

Hypertable::SshOutputCollector::SshOutputCollector ( size_t  buffer_size)
inline

Constructor.

Parameters
buffer_sizeSize of buffer pages to allocate

Definition at line 132 of file SshOutputCollector.h.

Member Function Documentation

void Hypertable::SshOutputCollector::add ( Buffer  buf)
inline

Adds filled buffer to collector.

Parameters
bufBuffer to add

Definition at line 148 of file SshOutputCollector.h.

Buffer Hypertable::SshOutputCollector::allocate_buffer ( )
inline

Allocate a buffer.

This function allocates a buffer of size m_buffer_size from m_arena

Returns
Allocated buffer

Definition at line 142 of file SshOutputCollector.h.

iterator Hypertable::SshOutputCollector::begin ( )
inline

Returns iterator at beginning of output collector.

Returns
Iterator at beginning of output collector

Definition at line 181 of file SshOutputCollector.h.

size_t Hypertable::SshOutputCollector::buffer_size ( )
inline

Returns buffer size.

This function returns the size of buffers returned by allocate_buffer().

Returns
Buffer size

Definition at line 137 of file SshOutputCollector.h.

bool Hypertable::SshOutputCollector::empty ( ) const
inline

Returns true if no output has been collected Returns true if there are no collected buffers or if none of the collected buffers contain data.

Returns
true if no output has been collected, false otherwise

Definition at line 158 of file SshOutputCollector.h.

iterator Hypertable::SshOutputCollector::end ( )
inline

Returns iterator at end of output collector.

Returns
Iterator at end of output collector

Definition at line 185 of file SshOutputCollector.h.

bool Hypertable::SshOutputCollector::last_line_is_partial ( )
inline

Returns true if last line collected is partial.

If the last character collected is not a newline character, this function returns true, indicating that the collection has stopped in the middle of a line and there are more line characters to be read.

Returns
true if last line collected is partial

Definition at line 174 of file SshOutputCollector.h.

Member Data Documentation

CharArena Hypertable::SshOutputCollector::m_arena
private

Character arena from which buffers are allocated.

Definition at line 191 of file SshOutputCollector.h.

size_t Hypertable::SshOutputCollector::m_buffer_size {}
private

Buffer size

Definition at line 189 of file SshOutputCollector.h.

std::vector<Buffer> Hypertable::SshOutputCollector::m_buffers
private

Vector of buffers.

Definition at line 193 of file SshOutputCollector.h.


The documentation for this class was generated from the following file: