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

input_output_string_port_rep ( string s2  )  [inline]

Definition at line 101 of file string_port.cpp.

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


Member Function Documentation

port accept (  )  [virtual, inherited]

Reimplemented in socket_port_rep.

Definition at line 88 of file port.cpp.

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

00088                   {
00089   mmerr << "port= " << expression () << lf;
00090   ERROR ("socket server port expected");
00091 }

bool busy (  )  [inline, virtual]

Reimplemented from port_rep.

Definition at line 86 of file string_port.cpp.

00086 { return true; }

nat can_read (  )  [inline, virtual]

Reimplemented from port_rep.

Definition at line 88 of file string_port.cpp.

References mmx::N(), pos, and s.

00088 { return N(s) - pos; }

nat can_write (  )  [inline, virtual]

Reimplemented from port_rep.

Definition at line 87 of file string_port.cpp.

00087 { return (nat) (-1); }

port component ( const string name  )  [virtual, inherited]

Reimplemented in composite_port_rep, and formatting_port_rep.

Definition at line 94 of file port.cpp.

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

00094                                        {
00095   mmerr << "port= " << expression () << lf;
00096   ERROR ("composite port expected");
00097 }

bool error_flag (  )  [virtual, inherited]

Reimplemented in composite_port_rep, formatting_port_rep, and error_port_rep.

Definition at line 39 of file port.cpp.

00039                       {
00040   return false;
00041 }

string error_message (  )  [virtual, inherited]

Reimplemented in composite_port_rep, formatting_port_rep, and error_port_rep.

Definition at line 44 of file port.cpp.

00044                          {
00045   return "";
00046 }

virtual syntactic expression (  )  const [inline, virtual]

Implements port_rep.

Definition at line 81 of file string_port.cpp.

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

00081                                         {
00082     return syn ("input_output_string_port",
00083                 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 84 of file port.cpp.

00084                  {
00085 }

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

Reimplemented in formatting_port_rep.

Definition at line 100 of file port.cpp.

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

00100                                         {
00101   mmerr << "port= " << expression () << lf;
00102   ERROR ("formatting port expected");  
00103 }

bool is_input_port (  )  [inline, virtual]

Reimplemented from port_rep.

Definition at line 85 of file string_port.cpp.

00085 { return true; }

bool is_output_port (  )  [inline, virtual]

Reimplemented from port_rep.

Definition at line 84 of file string_port.cpp.

00084 { return true; }

virtual void read ( char *  s,
nat  n 
) [virtual, inherited]
void read ( char *  x,
nat(obj->lex_length)   
) [inline]

Definition at line 90 of file string_port.cpp.

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

00090                              {
00091     ASSERT (pos + n <= N(s), "no more input");
00092     mem_copy (x, inside (s, pos), n);
00093     pos += n;
00094     if (pos > ((N(s) >> 1) + 1024)) {
00095       s= s (pos, N(s));
00096       pos= 0;
00097     }
00098   }

bool wait ( int  msecs  )  [virtual, inherited]

Reimplemented in posix_port_rep, composite_port_rep, and formatting_port_rep.

Definition at line 78 of file port.cpp.

00078                          {
00079   (void) msecs;
00080   return false;
00081 }

virtual void write ( const char *  s,
nat  n 
) [virtual, inherited]
void write ( const char *  x,
nat(obj->lex_length)   
) [inline]

Definition at line 89 of file string_port.cpp.

References s.

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


Member Data Documentation

MMX_ALLOCATORS int ref_count [inherited]

Definition at line 164 of file basix.hpp.


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

Generated on 6 Dec 2012 for basix by  doxygen 1.6.1