English
Kamil Dudka

Share Library (C++)

Detail souboru

Jméno:Stáhnoutsharectl_8h-source.html [Stáhnout]
Umístění: sharelib > api
Velikost:15.9 KB
Poslední změna:2022-09-09 13:06

Zdrojový kód

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ShareLibrary: sharectl/sharectl.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</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>
    <li><a href="pages.html"><span>Related&nbsp;Pages</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>sharectl/sharectl.h</h1><a href="sharectl_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef SHARECTL_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define SHARECTL_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include "<a class="code" href="sharelib_8h.html" title="Share library interface.">sharelib.h</a>"</span>
<a name="l00013"></a>00013 
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00016"></a>00016 <span class="comment">// #include &lt;map&gt;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="keyword">namespace </span>Share {
<a name="l00019"></a>00019 
<a name="l00024"></a><a class="code" href="classShare_1_1ArgParser.html">00024</a>   <span class="keyword">class </span><a class="code" href="classShare_1_1ArgParser.html" title="Parser for commnad-line arguments of sharectl utility.">ArgParser</a> {
<a name="l00025"></a>00025     <span class="keyword">public</span>:
<a name="l00029"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2">00029</a>       <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00030"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2e162fef37720444fef977200bf02eb9c">00030</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2e162fef37720444fef977200bf02eb9c">NONE</a> = 0,         <span class="comment">// No switch</span>
<a name="l00031"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e229244f580d494fad10f0965676942f01">00031</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e229244f580d494fad10f0965676942f01">HELP</a>,             <span class="comment">// Display help</span>
<a name="l00032"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e24b0bc4bda952a0ee3dd02223472ba5ba">00032</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e24b0bc4bda952a0ee3dd02223472ba5ba">CREATE</a>,           <span class="comment">// --create</span>
<a name="l00033"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e25448072b75a9bdfe2cb1352cc06eefcb">00033</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e25448072b75a9bdfe2cb1352cc06eefcb">CREATE_AND_WAIT</a>,  <span class="comment">// --create-and-wait</span>
<a name="l00034"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2247f671b29ab12f758df08b44cb084b3">00034</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2247f671b29ab12f758df08b44cb084b3">NOTIFY_ATTACH</a>,    <span class="comment">// --notify-attach</span>
<a name="l00035"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2ca55162b62532a0275132a3b3ea0f2b2">00035</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2ca55162b62532a0275132a3b3ea0f2b2">NOTIFY_DETACH</a>,    <span class="comment">// --notify-detach</span>
<a name="l00036"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e28f78c15527a51b66a1f91d5bd685aefb">00036</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e28f78c15527a51b66a1f91d5bd685aefb">UNLINK</a>,           <span class="comment">// --unlinnk</span>
<a name="l00037"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e231f83a3e73f5e9e12423044f5dc69be6">00037</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e231f83a3e73f5e9e12423044f5dc69be6">FORCE_DESTORY</a>,    <span class="comment">// --force-destroy</span>
<a name="l00038"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2f83bc04f0e91884858d9d3fca2eaabf8">00038</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2f83bc04f0e91884858d9d3fca2eaabf8">ALLOC</a>,            <span class="comment">// --alloc</span>
<a name="l00039"></a><a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2c11895814cb8bac09998bc69aa476a29">00039</a>         <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2c11895814cb8bac09998bc69aa476a29">FREE</a>              <span class="comment">// --free</span>
<a name="l00040"></a>00040       } <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2" title="commnad-line switches enumeration">Action</a>;
<a name="l00041"></a>00041 
<a name="l00047"></a>00047       <a class="code" href="classShare_1_1ArgParser.html#a14cf01392c9efe67ad078163b80bb98">ArgParser</a> (<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[]) <span class="keywordflow">throw</span> (<a class="code" href="classShare_1_1ShareException.html" title="General exception carrying text message inside.">ShareException</a>);
<a name="l00048"></a>00048       
<a name="l00052"></a>00052       <span class="keywordtype">bool</span> <a class="code" href="classShare_1_1ArgParser.html#0ef3360f7695cb1b18e2510b4add0ba7">isNewSegment</a>();
<a name="l00053"></a>00053       
<a name="l00057"></a>00057       <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classShare_1_1ArgParser.html#acadcaf82fb2a3d2f81ddc9c049eb51d">name</a>();
<a name="l00058"></a>00058       
<a name="l00062"></a>00062       <span class="keywordtype">size_t</span> <a class="code" href="classShare_1_1ArgParser.html#e9bde6bad8d5d0cfd53e01816cb6bf5a">size</a>();
<a name="l00063"></a>00063       
<a name="l00067"></a>00067       <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2" title="commnad-line switches enumeration">Action</a> <a class="code" href="classShare_1_1ArgParser.html#a2143c3c15f91599029f15518b34a1ca">action</a>();
<a name="l00068"></a>00068     <span class="keyword">private</span>:
<a name="l00069"></a>00069       std::string name_;
<a name="l00070"></a>00070       <span class="keywordtype">size_t</span> size_;
<a name="l00071"></a>00071       <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2" title="commnad-line switches enumeration">Action</a> action_;
<a name="l00072"></a>00072   };
<a name="l00073"></a>00073 
<a name="l00078"></a><a class="code" href="classShare_1_1ArgSwitchChecker.html">00078</a>   <span class="keyword">class </span><a class="code" href="classShare_1_1ArgSwitchChecker.html" title="Command-lnie switches mapping from string to enum.">ArgSwitchChecker</a> {
<a name="l00079"></a>00079       <span class="keyword">typedef</span> <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2" title="commnad-line switches enumeration">ArgParser::Action</a> <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2" title="commnad-line switches enumeration">TAction</a>;
<a name="l00080"></a>00080 
<a name="l00081"></a>00081       <span class="comment">// STL map</span>
<a name="l00082"></a>00082       <span class="comment">// typedef std::map&lt;std::string, TAction&gt; TMap;</span>
<a name="l00083"></a>00083 
<a name="l00084"></a>00084       <span class="comment">// Share library Map</span>
<a name="l00085"></a>00085       <span class="keyword">typedef</span> <a class="code" href="classShare_1_1Map.html" title="STL map.">Share::Map&lt;std::string, TAction&gt;</a> <a class="code" href="classShare_1_1Map.html" title="STL map.">TMap</a>;
<a name="l00086"></a>00086     <span class="keyword">public</span>:
<a name="l00087"></a>00087       <a class="code" href="classShare_1_1ArgSwitchChecker.html#d01798afd47dbef3a42f53c57d3ab9c9">ArgSwitchChecker</a>();
<a name="l00088"></a>00088       
<a name="l00094"></a>00094       <a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2" title="commnad-line switches enumeration">TAction</a> <a class="code" href="classShare_1_1ArgSwitchChecker.html#896f422509de15c22ee00b78e631a537">checkSwitch</a> (std::string str);
<a name="l00095"></a>00095     <span class="keyword">private</span>:
<a name="l00096"></a>00096       <a class="code" href="classShare_1_1Map.html" title="STL map.">TMap</a> map_;
<a name="l00097"></a>00097   };
<a name="l00098"></a>00098 
<a name="l00099"></a>00099   <span class="keyword">class </span><a class="code" href="classShare_1_1SharedSegment.html" title="Platform independent shared segment representation.">SharedSegment</a>;          <span class="comment">// Platform-independent shared segment representation</span>
<a name="l00100"></a>00100   <span class="keyword">class </span><a class="code" href="classShare_1_1SegmentHeader.html" title="Object placed at begin of each shared segment.">SegmentHeader</a>;          <span class="comment">// Object placed at begin of shared segment</span>
<a name="l00101"></a>00101   
<a name="l00106"></a><a class="code" href="classShare_1_1SharedSegmentWrapper.html">00106</a>   <span class="keyword">class </span><a class="code" href="classShare_1_1SharedSegmentWrapper.html" title="Wrapper around SharedSegment class for sharectl.">SharedSegmentWrapper</a> {
<a name="l00107"></a>00107     <span class="keyword">public</span>:
<a name="l00108"></a>00108       <a class="code" href="classShare_1_1SharedSegmentWrapper.html#99a3c82fa42fd86ce9ca144f46e79bc7">SharedSegmentWrapper</a>();
<a name="l00109"></a>00109       <a class="code" href="classShare_1_1SharedSegmentWrapper.html#ad25778cd515e8bff4160835f81c181b">~SharedSegmentWrapper</a>();
<a name="l00110"></a>00110       
<a name="l00117"></a>00117       <span class="keywordtype">void</span> <a class="code" href="classShare_1_1SharedSegmentWrapper.html#d95f794d8b81fc2de9b0cda1a0f2f331">create</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">size_t</span> size) <span class="keywordflow">throw</span> (<a class="code" href="classShare_1_1ShareException.html" title="General exception carrying text message inside.">ShareException</a>);
<a name="l00118"></a>00118       
<a name="l00124"></a>00124       <span class="keywordtype">void</span> <a class="code" href="classShare_1_1SharedSegmentWrapper.html#1efb4446afdd8653b0d3a35ea9fce986">attach</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *name) <span class="keywordflow">throw</span> (<a class="code" href="classShare_1_1ShareException.html" title="General exception carrying text message inside.">ShareException</a>);
<a name="l00125"></a>00125       
<a name="l00129"></a>00129       <a class="code" href="classShare_1_1SegmentHeader.html" title="Object placed at begin of each shared segment.">SegmentHeader</a>* <a class="code" href="classShare_1_1SharedSegmentWrapper.html#daa43c09926cde7de8d3338b0e126130">atAddr</a>() <span class="keywordflow">throw</span> (<a class="code" href="classShare_1_1ShareException.html" title="General exception carrying text message inside.">ShareException</a>);
<a name="l00130"></a>00130       
<a name="l00134"></a>00134       <span class="keywordtype">void</span> <a class="code" href="classShare_1_1SharedSegmentWrapper.html#feca03474403e7fdf671651817f9e8af">destroy</a>();
<a name="l00135"></a>00135     <span class="keyword">private</span>:
<a name="l00136"></a>00136       <a class="code" href="classShare_1_1SharedSegment.html" title="Platform independent shared segment representation.">SharedSegment</a> *segment_;
<a name="l00137"></a>00137   };
<a name="l00138"></a>00138 
<a name="l00143"></a><a class="code" href="classShare_1_1SegmentDebuger.html">00143</a>   <span class="keyword">class </span><a class="code" href="classShare_1_1SegmentDebuger.html" title="Wrapper around SegmentHeader class for sharectl.">SegmentDebuger</a> {
<a name="l00144"></a>00144     <span class="keyword">public</span>:
<a name="l00148"></a>00148       <a class="code" href="classShare_1_1SegmentDebuger.html#ad223c3b36ea46d9ed1fbfad0c93572e">SegmentDebuger</a> (<a class="code" href="classShare_1_1SegmentHeader.html" title="Object placed at begin of each shared segment.">SegmentHeader</a> *shareManager);
<a name="l00149"></a>00149       
<a name="l00154"></a>00154       <span class="keywordtype">void</span> <a class="code" href="classShare_1_1SegmentDebuger.html#e9039b7dced758a93ae995fef90d2e46">refCountAction</a> (<a class="code" href="classShare_1_1ArgParser.html#59f1ac618c56b18fdd7abc656b1e81e2" title="commnad-line switches enumeration">ArgParser::Action</a> action);
<a name="l00155"></a>00155       
<a name="l00159"></a>00159       <span class="keywordtype">bool</span> <a class="code" href="classShare_1_1SegmentDebuger.html#096d40acb5b0d9992648f2724316cd52">shouldBeDestroyed</a>();
<a name="l00160"></a>00160       
<a name="l00165"></a>00165       <span class="keywordtype">void</span> <a class="code" href="classShare_1_1SegmentDebuger.html#b8a69528a194b1c61ffcb6f70bd822b1">alloc</a>(<span class="keywordtype">size_t</span> size);
<a name="l00166"></a>00166       
<a name="l00171"></a>00171       <span class="keywordtype">void</span> <a class="code" href="classShare_1_1SegmentDebuger.html#18f0afbeabca4d77a604baacf08f0bc5">free</a>(<span class="keywordtype">size_t</span> relativePointer);
<a name="l00172"></a>00172     <span class="keyword">private</span>:
<a name="l00173"></a>00173       <a class="code" href="classShare_1_1SegmentHeader.html" title="Object placed at begin of each shared segment.">SegmentHeader</a> *segmentManager_;
<a name="l00174"></a>00174       <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classShare_1_1SegmentDebuger.html#df87410234a4afc1edb17f712e93f97a" title="Stream SegmentHeader statistics to output stream.">operator&lt;&lt; </a>(std::ostream &amp;, <a class="code" href="classShare_1_1SegmentDebuger.html" title="Wrapper around SegmentHeader class for sharectl.">SegmentDebuger</a>&amp;);
<a name="l00175"></a>00175   };
<a name="l00177"></a>00177   std::ostream&amp; <a class="code" href="namespaceShare.html#ed1abf2a7ef62a247b5e15022e1dbb40" title="Stream SegmentHeader statistics to output stream.">operator&lt;&lt; </a>(std::ostream &amp;, <a class="code" href="classShare_1_1SegmentDebuger.html" title="Wrapper around SegmentHeader class for sharectl.">SegmentDebuger</a>&amp;);
<a name="l00178"></a>00178 
<a name="l00179"></a>00179 }
<a name="l00180"></a>00180 <span class="preprocessor">#endif // SHARECTL_H</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 26 17:42:59 2007 for ShareLibrary by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
</body>
</html>