basix_doc 0.1
input_output_string_port_rep Class Reference
Inheritance diagram for input_output_string_port_rep:
port_rep rep_struct

List of all members.

Public Member Functions

Public Attributes


Detailed Description

Definition at line 76 of file string_port.cpp.


Constructor & Destructor Documentation

Definition at line 101 of file string_port.cpp.

: s (s2), pos (0) {}

Member Function Documentation

port accept ( ) [virtual, inherited]

Reimplemented in socket_port_rep.

Definition at line 87 of file port.cpp.

References ERROR, port_rep::expression(), mmx::lf, and mmx::mmerr.

                  {
  mmerr << "port= " << expression () << lf;
  ERROR ("socket server port expected");
}
bool busy ( ) [inline, virtual]

Reimplemented from port_rep.

Definition at line 86 of file string_port.cpp.

{ return true; }
nat can_read ( ) [inline, virtual]

Reimplemented from port_rep.

Definition at line 88 of file string_port.cpp.

References mmx::N().

{ return N(s) - pos; }
nat can_write ( ) [inline, virtual]

Reimplemented from port_rep.

Definition at line 87 of file string_port.cpp.

{ return (nat) (-1); }
port component ( const string name) [virtual, inherited]

Reimplemented in composite_port_rep, and formatting_port_rep.

Definition at line 93 of file port.cpp.

References ERROR, port_rep::expression(), mmx::lf, and mmx::mmerr.

                                       {
  mmerr << "port= " << expression () << lf;
  ERROR ("composite port expected");
}
bool error_flag ( ) [virtual, inherited]

Reimplemented in composite_port_rep, formatting_port_rep, and error_port_rep.

Definition at line 38 of file port.cpp.

                      {
  return false;
}
string error_message ( ) [virtual, inherited]

Reimplemented in composite_port_rep, formatting_port_rep, and error_port_rep.

Definition at line 43 of file port.cpp.

                         {
  return "";
}
virtual syntactic expression ( ) const [inline, virtual]

Implements port_rep.

Definition at line 81 of file string_port.cpp.

References mmx::N(), mmx::quote(), and mmx::syn().

                                        {
    return syn ("input_output_string_port",
                syntactic (quote (s (pos, N(s))))); }
void flush ( ) [virtual, inherited]

Reimplemented in composite_port_rep, file_port_rep, and formatting_port_rep.

Definition at line 83 of file port.cpp.

                 {
}
void format ( const print_format fm) [virtual, inherited]

Reimplemented in formatting_port_rep.

Definition at line 99 of file port.cpp.

References ERROR, port_rep::expression(), mmx::lf, and mmx::mmerr.

                                        {
  mmerr << "port= " << expression () << lf;
  ERROR ("formatting port expected");  
}
bool is_input_port ( ) [inline, virtual]

Reimplemented from port_rep.

Definition at line 85 of file string_port.cpp.

{ return true; }
bool is_output_port ( ) [inline, virtual]

Reimplemented from port_rep.

Definition at line 84 of file string_port.cpp.

{ return true; }
void read ( char *  x,
nat  n 
) [inline, virtual]

Reimplemented from port_rep.

Definition at line 90 of file string_port.cpp.

References ASSERT, mmx::inside(), mmx::mem_copy(), n, and mmx::N().

                             {
    ASSERT (pos + n <= N(s), "no more input");
    mem_copy (x, inside (s, pos), n);
    pos += n;
    if (pos > ((N(s) >> 1) + 1024)) {
      s= s (pos, N(s));
      pos= 0;
    }
  }
bool wait ( int  msecs) [virtual, inherited]

Reimplemented in posix_port_rep, composite_port_rep, and formatting_port_rep.

Definition at line 77 of file port.cpp.

                         {
  (void) msecs;
  return false;
}
void write ( const char *  x,
nat  n 
) [inline, virtual]

Reimplemented from port_rep.

Definition at line 89 of file string_port.cpp.

{ s << string (x, n); }

Member Data Documentation

MMX_ALLOCATORS int ref_count [inherited]

Definition at line 138 of file basix.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines