<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Y!LDA: src/commons/TopicLearner/Checkpointer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>src/commons/TopicLearner/Checkpointer.h</h1><a href="_checkpointer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment">/*</span>
<a name="l00038"></a>00038 <span class="comment"> * Checkpointer.h</span>
<a name="l00039"></a>00039 <span class="comment"> *</span>
<a name="l00040"></a>00040 <span class="comment"> *</span>
<a name="l00041"></a>00041 <span class="comment"> *</span>
<a name="l00042"></a>00042 <span class="comment"> *  Created on: 07-Mar-2011</span>
<a name="l00043"></a>00043 <span class="comment"> *      </span>
<a name="l00044"></a>00044 <span class="comment"> */</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="preprocessor">#ifndef CHECKPOINTER_H_</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define CHECKPOINTER_H_</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00050"></a>00050 <span class="comment"></span>
<a name="l00051"></a>00051 <span class="comment">//!Used to implement failure recovery</span>
<a name="l00052"></a>00052 <span class="comment"></span><span class="comment">/**</span>
<a name="l00053"></a>00053 <span class="comment"> * The checkpointer interface.</span>
<a name="l00054"></a>00054 <span class="comment"> * A checkpointer object helps create a checkpoint and</span>
<a name="l00055"></a>00055 <span class="comment"> * also to load from a checkpoint</span>
<a name="l00056"></a>00056 <span class="comment"> *</span>
<a name="l00057"></a>00057 <span class="comment"> * A checkpointer has two things:</span>
<a name="l00058"></a>00058 <span class="comment"> * 1. Metadata - (Ex.: The iteration at which this checkpoint was created)</span>
<a name="l00059"></a>00059 <span class="comment"> * 2. The method to serialize the necessary data structures to disk</span>
<a name="l00060"></a>00060 <span class="comment"> *</span>
<a name="l00061"></a>00061 <span class="comment"> */</span>
<a name="l00062"></a><a class="code" href="class_checkpointer.html">00062</a> <span class="keyword">class </span><a class="code" href="class_checkpointer.html" title="Used to implement failure recovery.">Checkpointer</a> {
<a name="l00063"></a>00063 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00064"></a>00064 <span class="comment">    //!Serialize the metadata</span>
<a name="l00065"></a>00065 <span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_checkpointer.html#a2dd3cfe87847c8e3d1dac001c8d75a8c" title="Serialize the metadata.">save_metadata</a>(std::string&amp; state) = 0;<span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">    //!Load the metadata</span>
<a name="l00067"></a>00067 <span class="comment"></span>    <span class="keyword">virtual</span> std::string <a class="code" href="class_checkpointer.html#ab3823bbe8bab653084697af29296323d" title="Load the metadata.">load_metadata</a>() = 0;<span class="comment"></span>
<a name="l00068"></a>00068 <span class="comment">    //!Serialize other necessary data structures</span>
<a name="l00069"></a>00069 <span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_checkpointer.html#a7a0f2b3220292d7a3be972776ea8f2d3" title="Serialize other necessary data structures.">checkpoint</a>() = 0;
<a name="l00070"></a>00070 };
<a name="l00071"></a>00071 
<a name="l00072"></a>00072 <span class="preprocessor">#endif </span><span class="comment">/* CHECKPOINTER_H_ */</span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:24 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
