<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>GearBox Project</title> <link rel="icon" href="gbx_icon_cardbox_sky.png" type="image/png"> <link rel="shortcut icon" href="gbx_icon_cardbox_sky.png" type="image/png"> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <!-- Google Analytics --> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-3583782-1"); pageTracker._initData(); pageTracker._trackPageview(); </script> <!-- Returning you to your regular programming --> </head><body> <!-- Header --> <table border="0" cellspacing="0" cellpadding="0"> <tr><!-- create row --> <!-- spacer cell --> <!-- #CC CC CC --> <td rowspan="1" colspan="1" bgcolor="#EEEEEE"> </td> <!-- menu cell --> <td width="170" rowspan="1" colspan="1" align="left" valign="top" bgcolor="#EEEEEE"> <p> </p> <p align="center"><a href="index.html"><img src="gbx_logo_cardbox_sky_150x150.png"></a></p><br> <strong>INTRODUCTION</strong><br> <strong><a href="gbx_doc_overview.html" style="text-decoration:none">Overview</a></strong><br> <strong><a href="gbx_doc_getting.html" style="text-decoration:none">Download and Install</a></strong><br> <!-- <strong><a href="gbx_doc_quickstart.html" style="text-decoration:none">Quick Start</a></strong><br> --> <strong><a href="gbx_doc_documentation.html" style="text-decoration:none">Documentation</a></strong><br> <strong><a href="gbx_doc_publications.html" style="text-decoration:none">Publications</a></strong><br> <br> <strong>REPOSITORY</strong><br> <strong><a href="group__gbx__libs.html" style="text-decoration:none">Libraries</a></strong><br> <!-- <strong><a href="group__gbx__utils.html" style="text-decoration:none">Utilities</a></strong><br> --> <br> <strong>DEVELOPER</strong><br> <!--<strong><a href="gbx_doc_tutorials.html" style="text-decoration:none">Tutorials</a></strong><br> <strong><a href="group__gbx__examples.html" style="text-decoration:none">Examples</a></strong><br>--> <strong><a href="gbx_doc_devguide.html" style="text-decoration:none">Dev Guide</a></strong><br> <!-- <strong><a href="gbx_doc_faq.html" style="text-decoration:none">FAQ</a></strong><br> --> <strong><a href="http://cdash.acfr.usyd.edu.au/index.php?project=Gearbox" style="text-decoration:none">Dashboard</a></strong><br> <!--<strong><a href="http://wiki2.cas.edu.au/orca">Wiki</a></strong><br> login/pass: orca/orca<br>--> <br> <strong>PEOPLE</strong><br> <strong><a href="gbx_doc_contributors.html" style="text-decoration:none">Contributors</a></strong><br> <strong><a href="gbx_doc_users.html" style="text-decoration:none">Users</a></strong><br> <br> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=216468&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a><br> <strong><a href="http://sourceforge.net/projects/gearbox">Project</a></strong><br> <strong><a href="http://sourceforge.net/project/showfiles.php?group_id=216468">Download</a></strong><br> <!--<strong><a href="http://sourceforge.net/tracker/?group_id=216468">Bugs/Feedback</a></strong><br>--> <strong><a href="http://sourceforge.net/mail/?group_id=216468">Mailing lists</a></strong></p> <p> </p> </td><!-- /menu cell --> <!-- one grey spacer cells --> <td rowspan="1" colspan="1" bgcolor="#EEEEEE"> </td> <!-- one white spacer cells --> <td rowspan="1" colspan="1"> </td> <!-- main content cell --> <td rowspan="1" colspan="1" align="left" valign="top"> <!-- Generated by Doxygen 1.6.2-20100208 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespaceflexiport.html">flexiport</a>::<a class="el" href="classflexiport_1_1LogWriterPort.html">LogWriterPort</a> </div> </div> <div class="contents"> <h1>flexiport::LogWriterPort Class Reference</h1><!-- doxytag: class="flexiport::LogWriterPort" --><!-- doxytag: inherits="flexiport::Port" --> <p>Logging implementation of the <a class="el" href="classflexiport_1_1Port.html">Port</a> class. An underlying <a class="el" href="classflexiport_1_1Port.html" title="Base Port class.">Port</a> object is used to perform the actual communications. All actions taken by that port are logged, including data transferred. The log file can be used with a <a class="el" href="classflexiport_1_1LogReaderPort.html" title="Simulated port using a log file.">LogReaderPort</a> to simulate a <a class="el" href="classflexiport_1_1Port.html" title="Base Port class.">Port</a> object and perform testing. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="logwriterport_8h_source.html">logwriterport.h</a>></code></p> <p>Inherits <a class="el" href="classflexiport_1_1Port.html">flexiport::Port</a>.</p> <p><a href="classflexiport_1_1LogWriterPort-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1937759696b73b59d86cc310d38967d0"></a><!-- doxytag: member="flexiport::LogWriterPort::Open" ref="a1937759696b73b59d86cc310d38967d0" args="()" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a1937759696b73b59d86cc310d38967d0">Open</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Open the port. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e7651188ae084c5cf17ae97ca328d16"></a><!-- doxytag: member="flexiport::LogWriterPort::Close" ref="a7e7651188ae084c5cf17ae97ca328d16" args="()" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a7e7651188ae084c5cf17ae97ca328d16">Close</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Close the port. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa41ffd589f2d0c1c76eace818582064"></a><!-- doxytag: member="flexiport::LogWriterPort::Read" ref="aaa41ffd589f2d0c1c76eace818582064" args="(void *const buffer, size_t count)" --> ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#aaa41ffd589f2d0c1c76eace818582064">Read</a> (void *const buffer, size_t count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Read from the port. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aec9d55571ed5f3d45f70df0803cd4c00"></a><!-- doxytag: member="flexiport::LogWriterPort::ReadFull" ref="aec9d55571ed5f3d45f70df0803cd4c00" args="(void *const buffer, size_t count)" --> ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#aec9d55571ed5f3d45f70df0803cd4c00">ReadFull</a> (void *const buffer, size_t count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Read the requested quantity of data from the port. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af89b6e34ababdba8ee6467f75c7eb334"></a><!-- doxytag: member="flexiport::LogWriterPort::Skip" ref="af89b6e34ababdba8ee6467f75c7eb334" args="(size_t count)" --> ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#af89b6e34ababdba8ee6467f75c7eb334">Skip</a> (size_t count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Dump data until the specified number of bytes have been read. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab888d664e96890df108d405b93628555"></a><!-- doxytag: member="flexiport::LogWriterPort::SkipUntil" ref="ab888d664e96890df108d405b93628555" args="(uint8_t terminator, unsigned int count)" --> ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#ab888d664e96890df108d405b93628555">SkipUntil</a> (uint8_t terminator, unsigned int count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Read and dump data until the specified termination character has been seen count times. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c2693df217b21da90d0fb13816035ed"></a><!-- doxytag: member="flexiport::LogWriterPort::BytesAvailable" ref="a7c2693df217b21da90d0fb13816035ed" args="()" --> ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a7c2693df217b21da90d0fb13816035ed">BytesAvailable</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of bytes waiting to be read at the port. Returns immediatly. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8b63015bc61759f1ad334c58e0f81b59"></a><!-- doxytag: member="flexiport::LogWriterPort::BytesAvailableWait" ref="a8b63015bc61759f1ad334c58e0f81b59" args="()" --> ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a8b63015bc61759f1ad334c58e0f81b59">BytesAvailableWait</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of bytes waiting after blocking for the timeout. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac22f166438c8a60aaae588a622aaaae0"></a><!-- doxytag: member="flexiport::LogWriterPort::Write" ref="ac22f166438c8a60aaae588a622aaaae0" args="(const void *const buffer, size_t count)" --> ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#ac22f166438c8a60aaae588a622aaaae0">Write</a> (const void *const buffer, size_t count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Write data to the port. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7bde2c7bc2fc3d56bae4c4db9f9a1b03"></a><!-- doxytag: member="flexiport::LogWriterPort::Flush" ref="a7bde2c7bc2fc3d56bae4c4db9f9a1b03" args="()" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a7bde2c7bc2fc3d56bae4c4db9f9a1b03">Flush</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Flush the port's input and output buffers, discarding all data. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a470c6b564dcbbb0d26982e3f362ace43"></a><!-- doxytag: member="flexiport::LogWriterPort::Drain" ref="a470c6b564dcbbb0d26982e3f362ace43" args="()" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a470c6b564dcbbb0d26982e3f362ace43">Drain</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Drain the port's input and output buffers. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abac6d50311d644bc2d6155222ff9d1be"></a><!-- doxytag: member="flexiport::LogWriterPort::GetStatus" ref="abac6d50311d644bc2d6155222ff9d1be" args="() const " --> std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#abac6d50311d644bc2d6155222ff9d1be">GetStatus</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the status of the port (type, device, etc). <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c0c20bcb6cbe05be56537bca28f6d0d"></a><!-- doxytag: member="flexiport::LogWriterPort::SetTimeout" ref="a1c0c20bcb6cbe05be56537bca28f6d0d" args="(Timeout timeout)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a1c0c20bcb6cbe05be56537bca28f6d0d">SetTimeout</a> (<a class="el" href="classflexiport_1_1Timeout.html">Timeout</a> timeout)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the timeout value in milliseconds. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a38c2d4ff01768ce3962d43179e084d74"></a><!-- doxytag: member="flexiport::LogWriterPort::SetCanRead" ref="a38c2d4ff01768ce3962d43179e084d74" args="(bool canRead)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a38c2d4ff01768ce3962d43179e084d74">SetCanRead</a> (bool canRead)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the read permissions of the port. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad210c9fd39b9c617384f45500e3a8fb8"></a><!-- doxytag: member="flexiport::LogWriterPort::SetCanWrite" ref="ad210c9fd39b9c617384f45500e3a8fb8" args="(bool canWrite)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#ad210c9fd39b9c617384f45500e3a8fb8">SetCanWrite</a> (bool canWrite)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the write permissions of the port. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5c17437c44b2314dd3105d5833ed3d96"></a><!-- doxytag: member="flexiport::LogWriterPort::IsOpen" ref="a5c17437c44b2314dd3105d5833ed3d96" args="() const " --> bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classflexiport_1_1LogWriterPort.html#a5c17437c44b2314dd3105d5833ed3d96">IsOpen</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Check if the port is open. <br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Logging implementation of the <a class="el" href="classflexiport_1_1Port.html">Port</a> class. An underlying <a class="el" href="classflexiport_1_1Port.html" title="Base Port class.">Port</a> object is used to perform the actual communications. All actions taken by that port are logged, including data transferred. The log file can be used with a <a class="el" href="classflexiport_1_1LogReaderPort.html" title="Simulated port using a log file.">LogReaderPort</a> to simulate a <a class="el" href="classflexiport_1_1Port.html" title="Base Port class.">Port</a> object and perform testing. </p> <p>To create a <a class="el" href="classflexiport_1_1LogWriterPort.html" title="Logging implementation of the Port class. An underlying Port object is used to perform...">LogWriterPort</a>, append "log" to the port type in the port options passed to CreatePort. For example, a log writer that uses a serial port would be specified as the type "seriallog". Similarly, for a TCP port, use "tcplog".</p> <dl class="note"><dt><b>Note:</b></dt><dd>Log files greater than 2GB in size are not supported.</dd> <dd> The timer resolution under Windows is milliseconds, not microseconds. This may result in inaccurate replay when using a log file created on a POSIX-compatible operating system.</dd></dl> <p>See the <a class="el" href="classflexiport_1_1Port.html">Port</a> class documentation for how to use the common API.</p> <dl class="user"><dt><b>Options</b></dt><dd><ul> <li>file <string><ul> <li>File name to save the log to.</li> <li>Default: port.log</li> </ul> </li> </ul> </dd></dl> <p>All unused options will be passed on to the underlying port used. </p> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="logwriterport_8h_source.html">logwriterport.h</a></li> <li>logwriterport.cpp</li> </ul> </div> </td> <td colspan="1"> </td> </tr> </table> <!-- end of table --> <hr size="1"><address style="align: right;"><small>Generated for GearBox by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.5 </small></address> </body> </html>