17:39
[skypekit:skypekit.git] / skypekit_2.0.0.190_29281_CB30 / interfaces / skype / cpp_embedded / documentation / html / skype-object_8cpp_source.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <title>SkypeKit C++ Wrapper: Main Page</title>
6 <link href="tabs.css" rel="stylesheet" type="text/css"/>
7 <link href="islander.css" rel="stylesheet" type="text/css"/>
8 </head>
9 <body>
10 <img src="..\skypekit.png" align="right">
11 <!-- Generated by Doxygen 1.6.2 -->
12 <script type="text/javascript">
13 <!--
14 function changeDisplayState (e){
15   var num=this.id.replace(/[^[0-9]/g,'');
16   var button=this.firstChild;
17   var sectionDiv=document.getElementById('dynsection'+num);
18   if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
19     sectionDiv.style.display='block';
20     button.src='open.gif';
21   }else{
22     sectionDiv.style.display='none';
23     button.src='closed.gif';
24   }
25 }
26 function initDynSections(){
27   var divs=document.getElementsByTagName('div');
28   var sectionCounter=1;
29   for(var i=0;i<divs.length-1;i++){
30     if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
31       var header=divs[i];
32       var section=divs[i+1];
33       var button=header.firstChild;
34       if (button!='IMG'){
35         divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
36         button=document.createElement('img');
37         divs[i].insertBefore(button,divs[i].firstChild);
38       }
39       header.style.cursor='pointer';
40       header.onclick=changeDisplayState;
41       header.id='dynheader'+sectionCounter;
42       button.src='closed.gif';
43       section.id='dynsection'+sectionCounter;
44       section.style.display='none';
45       section.style.marginLeft='14px';
46       sectionCounter++;
47     }
48   }
49 }
50 window.onload = initDynSections;
51 -->
52 </script>
53 <div class="navigation" id="top">
54   <div class="tabs">
55     <ul>
56       <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
57       <li><a href="annotated.html"><span>Classes</span></a></li>
58       <li class="current"><a href="files.html"><span>Files</span></a></li>
59       <li><a href="examples.html"><span>Examples</span></a></li>
60     </ul>
61   </div>
62   <div class="tabs">
63     <ul>
64       <li><a href="files.html"><span>File&nbsp;List</span></a></li>
65       <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
66     </ul>
67   </div>
68 <h1>skype-object.cpp</h1><a href="skype-object_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
69 <a name="l00002"></a>00002 <span class="preprocessor">#include &quot;<a class="code" href="skype-object_8h.html">skype-object.h</a>&quot;</span>
70 <a name="l00003"></a>00003 <span class="preprocessor">#include &quot;SidProtocolBinClient.hpp&quot;</span>
71 <a name="l00004"></a>00004 <span class="preprocessor">#include &quot;SidProtocolBinCommon.hpp&quot;</span>
72 <a name="l00005"></a>00005 <span class="preprocessor">#include &quot;skype-sid-transport.h&quot;</span>
73 <a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="skype-ref-list_8h.html">skype-ref-list.h</a>&quot;</span>
74 <a name="l00007"></a>00007 
75 <a name="l00008"></a>00008 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
76 <a name="l00009"></a>00009 
77 <a name="l00010"></a>00010 <span class="comment">// #define PROPCACHE_DISABLED 1</span>
78 <a name="l00011"></a>00011 
79 <a name="l00012"></a>00012 <span class="comment">//------------------------------------------------------------------------------</span>
80 <a name="l00013"></a>00013 
81 <a name="l00014"></a><a class="code" href="class_s_e_p_map.html#accafcdd60bf53c99c4fcf7bd661b91c4">00014</a> <a class="code" href="class_s_e_p_map.html#accafcdd60bf53c99c4fcf7bd661b91c4">SEPMap::SEPMap</a>(<span class="keyword">const</span> <a class="code" href="struct_p_m_a_p.html" title="For internal use only. This struct represents a dictionary item that contains property...">PMAP</a>* map)
82 <a name="l00015"></a>00015                 :p_map(map)
83 <a name="l00016"></a>00016 {
84 <a name="l00017"></a>00017 }
85 <a name="l00018"></a>00018 
86 <a name="l00019"></a><a class="code" href="class_s_e_p_map.html#ab3187482889869004025ed52d6fe3cec">00019</a> <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> <a class="code" href="class_s_e_p_map.html#ab3187482889869004025ed52d6fe3cec">SEPMap::map</a>(uint key)<span class="keyword"> const</span>
87 <a name="l00020"></a>00020 <span class="keyword"></span>{
88 <a name="l00021"></a>00021         <span class="keywordtype">int</span> n = 0;
89 <a name="l00022"></a>00022         <span class="keywordflow">while</span> (<a class="code" href="class_s_e_p_map.html#aef13561312c41942ea173cd8cc96038b">p_map</a>[n].prop) {
90 <a name="l00023"></a>00023                 <span class="keywordflow">if</span> (<a class="code" href="class_s_e_p_map.html#aef13561312c41942ea173cd8cc96038b">p_map</a>[n].key == key)
91 <a name="l00024"></a>00024                         <span class="keywordflow">return</span> <a class="code" href="class_s_e_p_map.html#aef13561312c41942ea173cd8cc96038b">p_map</a>[n].<a class="code" href="struct_p_m_a_p.html#a7cb1ac1aa1c3df0a9e0d8f424004573e">prop</a>;
92 <a name="l00025"></a>00025                 n++;
93 <a name="l00026"></a>00026         }
94 <a name="l00027"></a>00027         <span class="keywordflow">return</span> <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a>();
95 <a name="l00028"></a>00028 }
96 <a name="l00029"></a>00029 
97 <a name="l00030"></a><a class="code" href="class_s_e_p_map.html#a8fc1da6887bc1a8e8da538c6bd03ec42">00030</a> <span class="keywordtype">int</span> <a class="code" href="class_s_e_p_map.html#ab3187482889869004025ed52d6fe3cec">SEPMap::map</a>(<span class="keyword">const</span> <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a>&amp; prop)<span class="keyword"> const</span>
98 <a name="l00031"></a>00031 <span class="keyword"></span>{
99 <a name="l00032"></a>00032         <span class="keywordtype">int</span> n = 0;
100 <a name="l00033"></a>00033         <span class="keywordflow">while</span> (<a class="code" href="class_s_e_p_map.html#aef13561312c41942ea173cd8cc96038b">p_map</a>[n].prop) {
101 <a name="l00034"></a>00034                 <span class="keywordflow">if</span> (<a class="code" href="class_s_e_p_map.html#aef13561312c41942ea173cd8cc96038b">p_map</a>[n].prop == prop)
102 <a name="l00035"></a>00035                         <span class="keywordflow">return</span> <a class="code" href="class_s_e_p_map.html#aef13561312c41942ea173cd8cc96038b">p_map</a>[n].<a class="code" href="struct_p_m_a_p.html#a81157b3ffd51ac556df2d020c2528623">key</a>;
103 <a name="l00036"></a>00036 
104 <a name="l00037"></a>00037                 n++;
105 <a name="l00038"></a>00038         }
106 <a name="l00039"></a>00039         <span class="keywordflow">return</span> -1;
107 <a name="l00040"></a>00040 }
108 <a name="l00041"></a>00041 
109 <a name="l00042"></a>00042 <span class="comment">//------------------------------------------------------------------------------</span>
110 <a name="l00043"></a>00043 
111 <a name="l00044"></a><a class="code" href="class_s_e_object.html#ab66a520a90f0c4b859b0289804a00c0e">00044</a> <a class="code" href="class_s_e_object.html#ab66a520a90f0c4b859b0289804a00c0e">SEObject::SEObject</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> oid, <a class="code" href="class_s_e_root_object.html" title="SERootObject is the root module and entry point for API.">SERootObject</a>* s) :
112 <a name="l00045"></a>00045                 root(s),
113 <a name="l00046"></a>00046                 object_id(oid)
114 <a name="l00047"></a>00047 {
115 <a name="l00048"></a>00048         <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#a134db23bfbe2f9dd353552d85f4380d0">insert_object</a>(<span class="keyword">this</span>);
116 <a name="l00049"></a>00049 }
117 <a name="l00050"></a>00050 
118 <a name="l00051"></a><a class="code" href="class_s_e_object.html#a1bb460e0950b9a1b7f4034663532585f">00051</a> <a class="code" href="class_s_e_object.html#a1bb460e0950b9a1b7f4034663532585f">SEObject::~SEObject</a>()
119 <a name="l00052"></a>00052 {
120 <a name="l00053"></a>00053         <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#acac613852732e84e8495d945518c2d12">remove_object</a>(<a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>());
121 <a name="l00054"></a>00054 }
122 <a name="l00055"></a>00055 
123 <a name="l00056"></a><a class="code" href="class_s_e_object.html#ac63af2841da03285d2bb9c0fcb42e578">00056</a> <a class="code" href="class_s_e_int_dict.html" title="SEIntDict is a dictionary class of integers associated to strings.">SEIntDict</a> <a class="code" href="class_s_e_object.html#ac63af2841da03285d2bb9c0fcb42e578">SEObject::GetProps</a>(<span class="keyword">const</span> <a class="code" href="class_s_e_int_list.html" title="SEIntList represents a list of integers.">SEIntList</a>&amp; what)
124 <a name="l00057"></a>00057 {
125 <a name="l00058"></a>00058         <a class="code" href="class_s_e_int_dict.html" title="SEIntDict is a dictionary class of integers associated to strings.">SEIntDict</a> r;
126 <a name="l00059"></a>00059         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0,e=what.<a class="code" href="class_s_e_int_list.html#a194c6b22b720bcd2fefb806ae8d7604f">size</a>();i&lt;e;i++) {
127 <a name="l00060"></a>00060                 r.<a class="code" href="class_s_e_int_dict.html#a2f0d4fd5f3e3d9bb9068c85a31bf2b92">insert</a>(what[i], <a class="code" href="class_s_e_object.html#a62030d74b86beceb9c25c0351bb8e3e5">GetProp</a>(what[i]));
128 <a name="l00061"></a>00061         }
129 <a name="l00062"></a>00062                 
130 <a name="l00063"></a>00063         <span class="keywordflow">return</span> r;
131 <a name="l00064"></a>00064 }
132 <a name="l00065"></a>00065 
133 <a name="l00066"></a><a class="code" href="class_s_e_object.html#a1cec91fde2526648e8491442c56db336">00066</a> <span class="keywordtype">bool</span> <a class="code" href="class_s_e_object.html#a1cec91fde2526648e8491442c56db336">SEObject::FetchProps</a>(<span class="keyword">const</span> <a class="code" href="class_s_e_int_list.html" title="SEIntList represents a list of integers.">SEIntList</a>&amp; properties)
134 <a name="l00067"></a>00067 {
135 <a name="l00068"></a>00068         <span class="keywordflow">return</span> <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_properties(<a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_current_thread(), 
136 <a name="l00069"></a>00069                 <a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), properties) == Sid::Protocol::OK; 
137 <a name="l00070"></a>00070 }
138 <a name="l00071"></a>00071 
139 <a name="l00072"></a><a class="code" href="class_s_e_object.html#a62030d74b86beceb9c25c0351bb8e3e5">00072</a> <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> <a class="code" href="class_s_e_object.html#a62030d74b86beceb9c25c0351bb8e3e5">SEObject::GetProp</a>(<span class="keywordtype">int</span> property)
140 <a name="l00073"></a>00073 {
141 <a name="l00074"></a>00074         <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> value = <span class="stringliteral">&quot;&quot;</span>;
142 <a name="l00075"></a>00075         uchar kind;        
143 <a name="l00076"></a>00076         <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_property(<a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_current_thread(), <a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property);
144 <a name="l00077"></a>00077         <span class="keywordtype">void</span>* cached_ptr = <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#a59c05d0f51b48f304b61d908d546daa7">get_cached_prop</a>(<a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property, kind);
145 <a name="l00078"></a>00078         assert(cached_ptr);
146 <a name="l00079"></a>00079         
147 <a name="l00080"></a>00080         <span class="keywordflow">switch</span> (kind) {
148 <a name="l00081"></a>00081         <span class="keywordflow">case</span> Sid::Field::KIND_ENUM:
149 <a name="l00082"></a>00082         <span class="keywordflow">case</span> Sid::Field::KIND_INT:
150 <a name="l00083"></a>00083         <span class="keywordflow">case</span> Sid::Field::KIND_UINT:
151 <a name="l00084"></a>00084         <span class="keywordflow">case</span> Sid::Field::KIND_UINT64:
152 <a name="l00085"></a>00085         <span class="keywordflow">case</span> Sid::Field::KIND_OBJECTID: {
153 <a name="l00086"></a>00086                 <span class="keywordtype">int</span> val = *<span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span>*<span class="keyword">&gt;</span>(cached_ptr);
154 <a name="l00087"></a>00087                 value = <a class="code" href="class_s_e_string.html#a315f0dd8f3d6e532192b4e95835ebf92">SEString::from</a>(val);
155 <a name="l00088"></a>00088                 <span class="keywordflow">break</span>;
156 <a name="l00089"></a>00089         }
157 <a name="l00090"></a>00090         <span class="keywordflow">case</span> Sid::Field::KIND_TRUE:
158 <a name="l00091"></a>00091                 value = <span class="stringliteral">&quot;1&quot;</span>;
159 <a name="l00092"></a>00092                 <span class="keywordflow">break</span>;
160 <a name="l00093"></a>00093         <span class="keywordflow">case</span> Sid::Field::KIND_FALSE:
161 <a name="l00094"></a>00094                 value = <span class="stringliteral">&quot;0&quot;</span>;
162 <a name="l00095"></a>00095                 <span class="keywordflow">break</span>; 
163 <a name="l00096"></a>00096         <span class="keywordflow">case</span> Sid::Field::KIND_BOOLEAN: {
164 <a name="l00097"></a>00097                 <span class="keywordtype">bool</span> val = *<span class="keyword">static_cast&lt;</span><span class="keywordtype">bool</span>*<span class="keyword">&gt;</span>(cached_ptr);
165 <a name="l00098"></a>00098                 value = val ? <span class="stringliteral">&quot;1&quot;</span> : <span class="stringliteral">&quot;0&quot;</span>;
166 <a name="l00099"></a>00099                 <span class="keywordflow">break</span>;              
167 <a name="l00100"></a>00100         }
168 <a name="l00101"></a>00101         <span class="keywordflow">case</span> Sid::Field::KIND_STRING:
169 <a name="l00102"></a>00102         <span class="keywordflow">case</span> Sid::Field::KIND_FILENAME:
170 <a name="l00103"></a>00103         <span class="keywordflow">case</span> Sid::Field::KIND_XML: {
171 <a name="l00104"></a>00104                 value = *<span class="keyword">static_cast&lt;</span><a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a>*<span class="keyword">&gt;</span>(cached_ptr);
172 <a name="l00105"></a>00105                 <span class="keywordflow">break</span>;
173 <a name="l00106"></a>00106         }
174 <a name="l00107"></a>00107         <span class="keywordflow">case</span> Sid::Field::KIND_BINARY:
175 <a name="l00108"></a>00108                 value = <span class="stringliteral">&quot;&lt;binary&gt;&quot;</span>;
176 <a name="l00109"></a>00109                 <span class="keywordflow">break</span>;
177 <a name="l00110"></a>00110         }         
178 <a name="l00111"></a>00111         
179 <a name="l00112"></a>00112         <span class="keywordflow">return</span> value;        
180 <a name="l00113"></a>00113 }
181 <a name="l00114"></a>00114 
182 <a name="l00115"></a><a class="code" href="class_s_e_object.html#a91bf1159022e7e3d41e72bc5c0db9610">00115</a> <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> <a class="code" href="class_s_e_object.html#a91bf1159022e7e3d41e72bc5c0db9610">SEObject::GetStrProp</a>(uint property)
183 <a name="l00116"></a>00116 {
184 <a name="l00117"></a>00117         uchar kind;        
185 <a name="l00118"></a>00118         <span class="keywordtype">void</span>* cached_ptr = <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#a59c05d0f51b48f304b61d908d546daa7">get_cached_prop</a>(<a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property, kind);
186 <a name="l00119"></a>00119         assert((kind == Sid::Field::KIND_STRING 
187 <a name="l00120"></a>00120                 || kind == Sid::Field::KIND_XML) &amp;&amp; cached_ptr);
188 <a name="l00121"></a>00121         <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_property(<a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_current_thread(), <a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), 
189 <a name="l00122"></a>00122                 <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property);
190 <a name="l00123"></a>00123         
191 <a name="l00124"></a>00124         <span class="keywordflow">return</span> *<span class="keyword">static_cast&lt;</span><a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a>*<span class="keyword">&gt;</span>(cached_ptr); 
192 <a name="l00125"></a>00125 }
193 <a name="l00126"></a>00126 
194 <a name="l00127"></a><a class="code" href="class_s_e_object.html#a3bdfb6873200574a396d9e0f0d75654d">00127</a> <span class="keywordtype">bool</span> <a class="code" href="class_s_e_object.html#a3bdfb6873200574a396d9e0f0d75654d">SEObject::GetBoolProp</a>(uint property)
195 <a name="l00128"></a>00128 {
196 <a name="l00129"></a>00129         uchar kind;        
197 <a name="l00130"></a>00130         <span class="keywordtype">void</span>* cached_ptr = <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#a59c05d0f51b48f304b61d908d546daa7">get_cached_prop</a>(<a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property, kind);
198 <a name="l00131"></a>00131         assert((kind == Sid::Field::KIND_TRUE 
199 <a name="l00132"></a>00132                 || kind == Sid::Field::KIND_FALSE 
200 <a name="l00133"></a>00133                 || kind == Sid::Field::KIND_BOOLEAN) &amp;&amp; cached_ptr);
201 <a name="l00134"></a>00134         <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_property(<a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_current_thread(), <a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), 
202 <a name="l00135"></a>00135                 <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property);
203 <a name="l00136"></a>00136         
204 <a name="l00137"></a>00137         <span class="keywordflow">return</span> *<span class="keyword">static_cast&lt;</span><span class="keywordtype">bool</span>*<span class="keyword">&gt;</span>(cached_ptr); 
205 <a name="l00138"></a>00138 }
206 <a name="l00139"></a>00139 
207 <a name="l00140"></a><a class="code" href="class_s_e_object.html#a559c7d5692e0f8dc79fda4e0e4a13131">00140</a> uint <a class="code" href="class_s_e_object.html#a559c7d5692e0f8dc79fda4e0e4a13131">SEObject::GetUintProp</a>(uint property)
208 <a name="l00141"></a>00141 { 
209 <a name="l00142"></a>00142         uchar kind;
210 <a name="l00143"></a>00143         <span class="keywordtype">void</span>* cached_ptr = <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#a59c05d0f51b48f304b61d908d546daa7">get_cached_prop</a>(<a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property, kind);
211 <a name="l00144"></a>00144         assert((kind == Sid::Field::KIND_ENUM 
212 <a name="l00145"></a>00145                 || kind == Sid::Field::KIND_INT 
213 <a name="l00146"></a>00146                 || kind == Sid::Field::KIND_UINT 
214 <a name="l00147"></a>00147                 || kind == Sid::Field::KIND_UINT64) &amp;&amp; cached_ptr);
215 <a name="l00148"></a>00148         <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_property(<a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_current_thread(), <a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), 
216 <a name="l00149"></a>00149                 <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property);
217 <a name="l00150"></a>00150         
218 <a name="l00151"></a>00151         <span class="keywordflow">return</span> *<span class="keyword">static_cast&lt;</span>uint*<span class="keyword">&gt;</span>(cached_ptr); 
219 <a name="l00152"></a>00152 }
220 <a name="l00153"></a>00153 
221 <a name="l00154"></a><a class="code" href="class_s_e_object.html#af6bedc87d7cb723da65e9411c63e184d">00154</a> <a class="code" href="class_s_e_reference.html" title="For internal use only. This is the parent class for all the SkypeKit class-specifix...">SEReference</a> <a class="code" href="class_s_e_object.html#af6bedc87d7cb723da65e9411c63e184d">SEObject::GetObjProp</a>(uint property)
222 <a name="l00155"></a>00155 { 
223 <a name="l00156"></a>00156         uchar kind;       
224 <a name="l00157"></a>00157         <span class="keywordtype">void</span>* cached_ptr = <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#a59c05d0f51b48f304b61d908d546daa7">get_cached_prop</a>(<a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property, kind);
225 <a name="l00158"></a>00158         assert(kind == Sid::Field::KIND_OBJECTID &amp;&amp; cached_ptr);
226 <a name="l00159"></a>00159         <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_property(<a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_current_thread(), <a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), 
227 <a name="l00160"></a>00160                 <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property);
228 <a name="l00161"></a>00161         
229 <a name="l00162"></a>00162         <span class="keywordflow">return</span> *<span class="keyword">static_cast&lt;</span><a class="code" href="class_s_e_reference.html" title="For internal use only. This is the parent class for all the SkypeKit class-specifix...">SEReference</a>*<span class="keyword">&gt;</span>(cached_ptr); 
230 <a name="l00163"></a>00163 }
231 <a name="l00164"></a>00164 
232 <a name="l00165"></a><a class="code" href="class_s_e_object.html#ac4bce9ec49dc077ba55ea6e95b6d8df1">00165</a> <a class="code" href="class_s_e_binary.html" title="SEBinary Represents a BLOB. This used, for example, for avatar images.">SEBinary</a> <a class="code" href="class_s_e_object.html#ac4bce9ec49dc077ba55ea6e95b6d8df1">SEObject::GetBinProp</a>(uint property)
233 <a name="l00166"></a>00166 { 
234 <a name="l00167"></a>00167         uchar kind;       
235 <a name="l00168"></a>00168         <span class="keywordtype">void</span>* cached_ptr = <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#a59c05d0f51b48f304b61d908d546daa7">get_cached_prop</a>(<a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property, kind);
236 <a name="l00169"></a>00169         assert(kind == Sid::Field::KIND_BINARY &amp;&amp; cached_ptr);
237 <a name="l00170"></a>00170         <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_property(<a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;get_current_thread(), <a class="code" href="class_s_e_object.html#a1e6a19c413bbaf8ce44e4e6748daab4b">moduleID</a>(), 
238 <a name="l00171"></a>00171                 <a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), property);
239 <a name="l00172"></a>00172         
240 <a name="l00173"></a>00173         <span class="keywordflow">return</span> *<span class="keyword">static_cast&lt;</span><a class="code" href="class_s_e_binary.html" title="SEBinary Represents a BLOB. This used, for example, for avatar images.">SEBinary</a>*<span class="keyword">&gt;</span>(cached_ptr); 
241 <a name="l00174"></a>00174 }
242 <a name="l00175"></a>00175 
243 <a name="l00176"></a><a class="code" href="class_s_e_object.html#a21d1846b5a678e92440a78051b6790e2">00176</a> <a class="code" href="class_s_e_string_list.html" title="SEStringList represents a list of strings (SEString objects).">SEStringList</a> <a class="code" href="class_s_e_object.html#a21d1846b5a678e92440a78051b6790e2">SEObject::getPropDebug</a>(<span class="keywordtype">int</span> key,  <span class="keyword">const</span> <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a>&amp; value)
244 <a name="l00177"></a>00177 {
245 <a name="l00178"></a>00178         <a class="code" href="class_s_e_string_list.html" title="SEStringList represents a list of strings (SEString objects).">SEStringList</a> result;
246 <a name="l00179"></a>00179         <span class="keyword">const</span> <a class="code" href="class_s_e_p_map.html" title="For internal use only. Provides property / string map access. Used in GetPropDebug...">SEPMap</a> pm(<a class="code" href="class_s_e_object.html#a097dcd2745941502d13a2c159c5e8907">getPMap</a>());
247 <a name="l00180"></a>00180         
248 <a name="l00181"></a>00181         result.<a class="code" href="class_s_e_string_list.html#adfd5ca815c8569c0c3ee85486c2326e1">append</a>(<a class="code" href="class_s_e_object.html#a54986b6e4e026178031272707d3ce98d">getNamespace</a>());
249 <a name="l00182"></a>00182         result.<a class="code" href="class_s_e_string_list.html#adfd5ca815c8569c0c3ee85486c2326e1">append</a>(pm.<a class="code" href="class_s_e_p_map.html#ab3187482889869004025ed52d6fe3cec">map</a>(key));
250 <a name="l00183"></a>00183         <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> better_value = value;
251 <a name="l00184"></a>00184         <span class="keyword">const</span> <a class="code" href="struct_e_m_a_p.html" title="For internal use only. This struct represents a dictionary item that contains property...">EMAP</a>* em = <a class="code" href="class_s_e_object.html#a4bcca136350aac4c69669755c6b84513">getEMap</a>();
252 <a name="l00185"></a>00185         <span class="keywordflow">while</span> (em-&gt;<a class="code" href="struct_e_m_a_p.html#a47d6d9251dde04678c3dd038ce514f02">prop</a>)
253 <a name="l00186"></a>00186         {
254 <a name="l00187"></a>00187                 <span class="keywordflow">if</span> (key == em-&gt;<a class="code" href="struct_e_m_a_p.html#a47d6d9251dde04678c3dd038ce514f02">prop</a>)
255 <a name="l00188"></a>00188                 {
256 <a name="l00189"></a>00189                         <a class="code" href="class_s_e_p_map.html" title="For internal use only. Provides property / string map access. Used in GetPropDebug...">SEPMap</a> cur_map(em-&gt;<a class="code" href="struct_e_m_a_p.html#a9893fba7b3df01331138fa71cc6b3a7e">map</a>);
257 <a name="l00190"></a>00190                         better_value = cur_map.<a class="code" href="class_s_e_p_map.html#ab3187482889869004025ed52d6fe3cec">map</a>(value.<a class="code" href="class_s_e_string.html#ad638d3479025452c9d3cc9a8df5bc41f">toUInt</a>());
258 <a name="l00191"></a>00191                         <span class="keywordflow">break</span>;
259 <a name="l00192"></a>00192                 }
260 <a name="l00193"></a>00193                 em++;
261 <a name="l00194"></a>00194         };
262 <a name="l00195"></a>00195 
263 <a name="l00196"></a>00196         result.<a class="code" href="class_s_e_string_list.html#adfd5ca815c8569c0c3ee85486c2326e1">append</a>(better_value);
264 <a name="l00197"></a>00197         <span class="keywordflow">return</span> result;
265 <a name="l00198"></a>00198 }
266 <a name="l00199"></a>00199 
267 <a name="l00200"></a><a class="code" href="class_s_e_object.html#a63e10a5deb0bc41e6dd4f0181c505b88">00200</a> <a class="code" href="class_s_e_string_list.html" title="SEStringList represents a list of strings (SEString objects).">SEStringList</a> <a class="code" href="class_s_e_object.html#a21d1846b5a678e92440a78051b6790e2">SEObject::getPropDebug</a>(<span class="keywordtype">int</span> key,  <span class="keyword">const</span> uint value)
268 <a name="l00201"></a>00201 {
269 <a name="l00202"></a>00202         <a class="code" href="class_s_e_string_list.html" title="SEStringList represents a list of strings (SEString objects).">SEStringList</a> result;
270 <a name="l00203"></a>00203         <span class="keyword">const</span> <a class="code" href="class_s_e_p_map.html" title="For internal use only. Provides property / string map access. Used in GetPropDebug...">SEPMap</a> pm(<a class="code" href="class_s_e_object.html#a097dcd2745941502d13a2c159c5e8907">getPMap</a>());
271 <a name="l00204"></a>00204 
272 <a name="l00205"></a>00205         result.<a class="code" href="class_s_e_string_list.html#adfd5ca815c8569c0c3ee85486c2326e1">append</a>(<a class="code" href="class_s_e_object.html#a54986b6e4e026178031272707d3ce98d">getNamespace</a>());
273 <a name="l00206"></a>00206         result.<a class="code" href="class_s_e_string_list.html#adfd5ca815c8569c0c3ee85486c2326e1">append</a>(pm.<a class="code" href="class_s_e_p_map.html#ab3187482889869004025ed52d6fe3cec">map</a>(key));
274 <a name="l00207"></a>00207         <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> better_value = <a class="code" href="class_s_e_string.html#a315f0dd8f3d6e532192b4e95835ebf92">SEString::from</a>(value);
275 <a name="l00208"></a>00208         <span class="keyword">const</span> <a class="code" href="struct_e_m_a_p.html" title="For internal use only. This struct represents a dictionary item that contains property...">EMAP</a>* em = <a class="code" href="class_s_e_object.html#a4bcca136350aac4c69669755c6b84513">getEMap</a>();
276 <a name="l00209"></a>00209 
277 <a name="l00210"></a>00210         <span class="keywordflow">while</span> (em-&gt;<a class="code" href="struct_e_m_a_p.html#a47d6d9251dde04678c3dd038ce514f02">prop</a>) {
278 <a name="l00211"></a>00211                 <span class="keywordflow">if</span> (key == em-&gt;<a class="code" href="struct_e_m_a_p.html#a47d6d9251dde04678c3dd038ce514f02">prop</a>) {
279 <a name="l00212"></a>00212                         <a class="code" href="class_s_e_p_map.html" title="For internal use only. Provides property / string map access. Used in GetPropDebug...">SEPMap</a> cur_map(em-&gt;<a class="code" href="struct_e_m_a_p.html#a9893fba7b3df01331138fa71cc6b3a7e">map</a>);
280 <a name="l00213"></a>00213                         better_value = cur_map.<a class="code" href="class_s_e_p_map.html#ab3187482889869004025ed52d6fe3cec">map</a>(value);
281 <a name="l00214"></a>00214                         <span class="keywordflow">break</span>;
282 <a name="l00215"></a>00215                 }
283 <a name="l00216"></a>00216                 em++;
284 <a name="l00217"></a>00217         };
285 <a name="l00218"></a>00218 
286 <a name="l00219"></a>00219         result.<a class="code" href="class_s_e_string_list.html#adfd5ca815c8569c0c3ee85486c2326e1">append</a>(better_value);
287 <a name="l00220"></a>00220         <span class="keywordflow">return</span> result;
288 <a name="l00221"></a>00221 }
289 <a name="l00222"></a>00222 
290 <a name="l00223"></a>00223 <span class="comment">//------------------------------------------------------------------------------</span>
291 <a name="l00224"></a>00224 
292 <a name="l00225"></a>00225 Sid::Session::Pool <a class="code" href="class_s_e_root_object.html#a33d933ee59ba255ee5dccefdad3dc385">SERootObject::M_pool</a>;
293 <a name="l00226"></a>00226 <a class="code" href="class_s_e_root_object.html" title="SERootObject is the root module and entry point for API.">SERootObject</a>* <a class="code" href="class_s_e_root_object.html#aa24dca40cb63bcd1fef47e0e96e807e3">SERootObject::m_instance</a> = 0;
294 <a name="l00227"></a>00227 
295 <a name="l00228"></a><a class="code" href="class_s_e_root_object.html#a583c3be6b872e14d8947b3e0158be814">00228</a> <a class="code" href="class_s_e_root_object.html#a583c3be6b872e14d8947b3e0158be814">SERootObject::~SERootObject</a>()
296 <a name="l00229"></a>00229 {
297 <a name="l00230"></a>00230         <a class="code" href="class_s_e_root_object.html#aa24dca40cb63bcd1fef47e0e96e807e3">m_instance</a> = 0;
298 <a name="l00231"></a>00231         <span class="comment">//removing root object, clear all propcache</span>
299 <a name="l00232"></a>00232         <span class="keywordflow">for</span> (uint i = 0; i &lt; <a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>.<a class="code" href="class_s_e_ptr_int_dict.html#aa83bcafb3bbaaf1d1ee225a1800e6ce8">size</a>(); i++) {
300 <a name="l00233"></a>00233                 <span class="keywordtype">void</span>* structptr = (<span class="keywordtype">void</span>*)<a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>[i];
301 <a name="l00234"></a>00234                 <span class="keywordflow">if</span> (!structptr) {   
302 <a name="l00235"></a>00235             <span class="comment">//            delete structptr; //fix delete void*         </span>
303 <a name="l00236"></a>00236                 }                       
304 <a name="l00237"></a>00237         }
305 <a name="l00238"></a>00238 }
306 <a name="l00239"></a>00239 
307 <a name="l00240"></a><a class="code" href="class_s_e_root_object.html#afc6ee8cd6f14dc94873d587b41485ebc">00240</a> <a class="code" href="class_s_e_root_object.html#afc6ee8cd6f14dc94873d587b41485ebc">SERootObject::SERootObject</a>(<a class="code" href="class_s_e_transport.html" title="Abstract interface for transport layer.">SETransport</a> *transport, <span class="keyword">const</span> <span class="keywordtype">char</span>* log_path, uint num_event_handlers) :
308 <a name="l00241"></a>00241                 SEClientSession(new SESidTransport(transport, log_path), num_event_handlers)
309 <a name="l00242"></a>00242 {
310 <a name="l00243"></a>00243         <a class="code" href="class_s_e_root_object.html#aa24dca40cb63bcd1fef47e0e96e807e3">m_instance</a> = <span class="keyword">this</span>;
311 <a name="l00244"></a>00244 }
312 <a name="l00245"></a>00245 
313 <a name="l00246"></a><a class="code" href="class_s_e_root_object.html#a4ed48ad464430a0702839df779807aef">00246</a> <a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>* <a class="code" href="class_s_e_root_object.html#a4ed48ad464430a0702839df779807aef">SERootObject::get_object</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> oid)
314 <a name="l00247"></a>00247 {
315 <a name="l00248"></a>00248         Sid::Mutex::ScopedLock sl(<a class="code" href="class_s_e_root_object.html#ab6142b1fb467a2beeb4ba45cc136bc16">m_objmap_lock</a>);
316 <a name="l00249"></a>00249         <span class="keywordflow">return</span> (<a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>*)<a class="code" href="class_s_e_root_object.html#a9198fc1b91f7039136057aefa480cc8e">oid2obj</a>.<a class="code" href="class_s_e_obj_dict.html#accc273e93af5387886c4178fe7adfad8">find</a>(oid);
317 <a name="l00250"></a>00250 }
318 <a name="l00251"></a>00251 
319 <a name="l00252"></a><a class="code" href="class_s_e_root_object.html#acac613852732e84e8495d945518c2d12">00252</a> <span class="keywordtype">void</span> <a class="code" href="class_s_e_root_object.html#acac613852732e84e8495d945518c2d12">SERootObject::remove_object</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> oid)
320 <a name="l00253"></a>00253 {       
321 <a name="l00254"></a>00254         {
322 <a name="l00255"></a>00255                 Sid::Mutex::ScopedLock sl(<a class="code" href="class_s_e_root_object.html#a7db91fa64635d27e17fe5855384a59ae">m_propcache_lock</a>);
323 <a name="l00256"></a>00256                 <a class="code" href="class_s_e_root_object.html#a9198fc1b91f7039136057aefa480cc8e">oid2obj</a>.<a class="code" href="class_s_e_obj_dict.html#a30021a9d239f3d6439b77d5a9e2263cf">remove</a>(oid);
324 <a name="l00257"></a>00257         }
325 <a name="l00258"></a>00258  
326 <a name="l00259"></a>00259         Sid::Mutex::ScopedLock sl(<a class="code" href="class_s_e_root_object.html#a7db91fa64635d27e17fe5855384a59ae">m_propcache_lock</a>);
327 <a name="l00260"></a>00260         <span class="keywordtype">void</span>* structptr = (<span class="keywordtype">void</span>*)<a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>.<a class="code" href="class_s_e_ptr_int_dict.html#a0bb35ddff347d074e42289a5858984d3">find</a>(oid);
328 <a name="l00261"></a>00261         <span class="keywordflow">if</span> (!structptr) {   
329 <a name="l00262"></a>00262                 <a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>.<a class="code" href="class_s_e_ptr_int_dict.html#a0223d03d10cb98e07f39c952035bf188">remove</a>(oid);
330 <a name="l00263"></a>00263      <span class="comment">//           delete structptr;       //fix delete void*</span>
331 <a name="l00264"></a>00264         }
332 <a name="l00265"></a>00265 }
333 <a name="l00266"></a>00266 
334 <a name="l00267"></a><a class="code" href="class_s_e_root_object.html#a134db23bfbe2f9dd353552d85f4380d0">00267</a> <span class="keywordtype">void</span> <a class="code" href="class_s_e_root_object.html#a134db23bfbe2f9dd353552d85f4380d0">SERootObject::insert_object</a>(<a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>* obj)
335 <a name="l00268"></a>00268 {
336 <a name="l00269"></a>00269         <a class="code" href="class_s_e_root_object.html#a9198fc1b91f7039136057aefa480cc8e">oid2obj</a>.<a class="code" href="class_s_e_obj_dict.html#ae50095f56a922b205c9e1e5a1183a164">insert</a>(obj-&gt;<a class="code" href="class_s_e_object.html#ae75b79e31b0a2f9524e72c07655da445">getOID</a>(), obj);
337 <a name="l00270"></a>00270         <a class="code" href="class_s_e_root_object.html#ab6142b1fb467a2beeb4ba45cc136bc16">m_objmap_lock</a>.unlock();
338 <a name="l00271"></a>00271 }
339 <a name="l00272"></a>00272 
340 <a name="l00273"></a>00273 <a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>* <a class="code" href="class_s_e_root_object.html#adf9eda333f39a71bafa68fd916197931">SERootObject::resolve_object</a>(<span class="keyword">const</span> uint&amp; oid, <span class="keyword">const</span> uint&amp; mid)
341 <a name="l00274"></a>00274 {
342 <a name="l00275"></a>00275         <a class="code" href="class_s_e_root_object.html#ab6142b1fb467a2beeb4ba45cc136bc16">m_objmap_lock</a>.lock();
343 <a name="l00276"></a>00276         <a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>* obj = (<a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>*)<a class="code" href="class_s_e_root_object.html#a9198fc1b91f7039136057aefa480cc8e">oid2obj</a>.<a class="code" href="class_s_e_obj_dict.html#accc273e93af5387886c4178fe7adfad8">find</a>(oid);
344 <a name="l00277"></a>00277         <span class="keywordflow">if</span> (!obj) 
345 <a name="l00278"></a>00278                 obj = <a class="code" href="class_s_e_root_object.html#a218a6fb537538d8f67fbc8390fcb9a08">factory</a>(oid, mid);
346 <a name="l00279"></a>00279         <span class="keywordflow">else</span> {
347 <a name="l00280"></a>00280                 <a class="code" href="class_s_e_root_object.html#ab6142b1fb467a2beeb4ba45cc136bc16">m_objmap_lock</a>.unlock();        
348 <a name="l00281"></a>00281         }             
349 <a name="l00282"></a>00282                         
350 <a name="l00283"></a>00283         <span class="keywordflow">return</span> obj;
351 <a name="l00284"></a>00284 }
352 <a name="l00285"></a>00285 
353 <a name="l00286"></a><a class="code" href="class_s_e_root_object.html#aa119c205c451c125fbc7722265bb10d9">00286</a> Sid::Session::Pool* <a class="code" href="class_s_e_root_object.html#aa119c205c451c125fbc7722265bb10d9">SERootObject::get_pool</a>()
354 <a name="l00287"></a>00287 {
355 <a name="l00288"></a>00288         <span class="keywordflow">return</span> &amp;<a class="code" href="class_s_e_root_object.html#a33d933ee59ba255ee5dccefdad3dc385">M_pool</a>;
356 <a name="l00289"></a>00289 };
357 <a name="l00290"></a>00290 
358 <a name="l00291"></a><a class="code" href="class_s_e_root_object.html#ae1f779e68bbb5fe37fe57cc61cd70fa7">00291</a> <span class="keywordtype">bool</span> <a class="code" href="class_s_e_root_object.html#ae1f779e68bbb5fe37fe57cc61cd70fa7">SERootObject::init</a>(uint retries, uint latency)
359 <a name="l00292"></a>00292 {
360 <a name="l00293"></a>00293         <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> connection_message = <span class="stringliteral">&quot;SKYPEKIT[]&quot;</span>;
361 <a name="l00294"></a>00294         <span class="keywordflow">return</span> ((SESidTransport*)m_transport)-&gt;start(connection_message, retries, latency) == Sid::TransportInterface::OK;
362 <a name="l00295"></a>00295 }
363 <a name="l00296"></a>00296 
364 <a name="l00297"></a><a class="code" href="class_s_e_root_object.html#a988e7ce09ff1317bb8f173eaf2f23ba6">00297</a> <span class="keywordtype">void</span> <a class="code" href="class_s_e_root_object.html#a988e7ce09ff1317bb8f173eaf2f23ba6">SERootObject::print_object_statistics</a>()
365 <a name="l00298"></a>00298 {
366 <a name="l00299"></a>00299         <span class="keywordflow">for</span> (uint i = 0; i &lt; <a class="code" href="class_s_e_root_object.html#a9198fc1b91f7039136057aefa480cc8e">oid2obj</a>.<a class="code" href="class_s_e_obj_dict.html#ae68f72f9b339eeb92ddf4b94d9f82081">size</a>(); i++) {
367 <a name="l00300"></a>00300                 <a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>* <span class="keywordtype">object</span> = (<a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>*)<a class="code" href="class_s_e_root_object.html#a9198fc1b91f7039136057aefa480cc8e">oid2obj</a>[i];
368 <a name="l00301"></a>00301                 printf(<span class="stringliteral">&quot;\t%d| %s oid %d\n&quot;</span>, i+1, (<span class="keyword">const</span> <span class="keywordtype">char</span>*)object-&gt;<a class="code" href="class_s_e_object.html#a54986b6e4e026178031272707d3ce98d">getNamespace</a>(), <span class="keywordtype">object</span>-&gt;getOID());
369 <a name="l00302"></a>00302         }
370 <a name="l00303"></a>00303 }
371 <a name="l00304"></a>00304 
372 <a name="l00305"></a><a class="code" href="class_s_e_root_object.html#a8aa609d4b0ca2ba5333a9341801c829f">00305</a> <span class="keywordtype">bool</span> <a class="code" href="class_s_e_root_object.html#a8aa609d4b0ca2ba5333a9341801c829f">SERootObject::FetchMultipleObjectsProps</a>(uint modid, <span class="keyword">const</span> <a class="code" href="class_s_e_ref_list.html" title="SERefList represents a list of SEReference objects.">SERefList</a> objects, <span class="keyword">const</span> <a class="code" href="class_s_e_int_list.html" title="SEIntList represents a list of integers.">SEIntList</a> properties)
373 <a name="l00306"></a>00306 {
374 <a name="l00307"></a>00307         <span class="keywordflow">return</span> get_properties(get_current_thread(), modid, objects, properties) == Sid::Protocol::OK;        
375 <a name="l00308"></a>00308 }
376 <a name="l00309"></a>00309 
377 <a name="l00310"></a><a class="code" href="class_s_e_root_object.html#a59c05d0f51b48f304b61d908d546daa7">00310</a> <span class="keywordtype">void</span>* <a class="code" href="class_s_e_root_object.html#a59c05d0f51b48f304b61d908d546daa7">SERootObject::get_cached_prop</a>(<span class="keyword">const</span> uint&amp; moduleid, <span class="keyword">const</span> uint&amp; objectid, <span class="keyword">const</span> uint&amp; property_id, uchar&amp; kind)
378 <a name="l00311"></a>00311 {
379 <a name="l00312"></a>00312         Sid::Mutex::ScopedLock sl(<a class="code" href="class_s_e_root_object.html#a7db91fa64635d27e17fe5855384a59ae">m_propcache_lock</a>);
380 <a name="l00313"></a>00313         <span class="keywordtype">void</span>* structptr = (<span class="keywordtype">void</span>*)<a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>.<a class="code" href="class_s_e_ptr_int_dict.html#a0bb35ddff347d074e42289a5858984d3">find</a>(objectid);
381 <a name="l00314"></a>00314         <span class="keywordflow">if</span> (!structptr) {   
382 <a name="l00315"></a>00315                 structptr = <a class="code" href="class_s_e_root_object.html#af50957d9a4285742f76b9f20b0717042">prop_factory</a>(moduleid);  
383 <a name="l00316"></a>00316                 assert(structptr);
384 <a name="l00317"></a>00317                 <a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>.<a class="code" href="class_s_e_ptr_int_dict.html#a7e2487a31f556fddb716b2cea60596b0">insert</a>(objectid, structptr);   
385 <a name="l00318"></a>00318 <span class="comment">//                 printf(&quot;creating cache for oid %u\n\n&quot;, objectid);      </span>
386 <a name="l00319"></a>00319         }
387 <a name="l00320"></a>00320         
388 <a name="l00321"></a>00321         Sid::Field* field = get_property_desc(moduleid, property_id);
389 <a name="l00322"></a>00322         <span class="keywordflow">if</span> (field) {
390 <a name="l00323"></a>00323                 kind = field-&gt;kind();
391 <a name="l00324"></a>00324                 <span class="keywordflow">return</span> field-&gt;offset(structptr);
392 <a name="l00325"></a>00325         } 
393 <a name="l00326"></a>00326 <span class="comment">//         printf(&quot;returning 0 for prop %u\n&quot;, property_id);            </span>
394 <a name="l00327"></a>00327                 
395 <a name="l00328"></a>00328         <span class="keywordflow">return</span> 0;
396 <a name="l00329"></a>00329 }
397 <a name="l00330"></a>00330 
398 <a name="l00331"></a><a class="code" href="class_s_e_root_object.html#a69084e563f3d809101eadbac50989984">00331</a> <span class="keywordtype">void</span> <a class="code" href="class_s_e_root_object.html#a69084e563f3d809101eadbac50989984">SERootObject::add_prop_cached</a>(<span class="keyword">const</span> uint&amp; moduleid, <span class="keyword">const</span> uint&amp; objectid, <span class="keyword">const</span> uint&amp; property_id)
399 <a name="l00332"></a>00332 {
400 <a name="l00333"></a>00333 <span class="preprocessor">#ifndef PROPCACHE_DISABLED</span>
401 <a name="l00334"></a>00334 <span class="preprocessor"></span>        Sid::Mutex::ScopedLock sl(<a class="code" href="class_s_e_root_object.html#a7db91fa64635d27e17fe5855384a59ae">m_propcache_lock</a>); 
402 <a name="l00335"></a>00335         <span class="keywordtype">void</span>* structptr = (<span class="keywordtype">void</span>*)<a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>.<a class="code" href="class_s_e_ptr_int_dict.html#a0bb35ddff347d074e42289a5858984d3">find</a>(objectid);  
403 <a name="l00336"></a>00336 <span class="comment">//         printf(&quot;adding to propcache oid %u prop %u %p\n&quot;, objectid, property_id, structptr); </span>
404 <a name="l00337"></a>00337         <span class="keywordflow">if</span> (structptr) {   
405 <a name="l00338"></a>00338                 Sid::List_uint* cp = <a class="code" href="class_s_e_root_object.html#ab38292106ac39509a0c2edf6c800a479">prop_cached_list</a>(structptr, moduleid);
406 <a name="l00339"></a>00339                 <span class="keywordflow">if</span> (!cp-&gt;contains(property_id)) cp-&gt;append(property_id);       
407 <a name="l00340"></a>00340         }
408 <a name="l00341"></a>00341 <span class="preprocessor">#endif                    </span>
409 <a name="l00342"></a>00342 <span class="preprocessor"></span>}
410 <a name="l00343"></a>00343 
411 <a name="l00344"></a><a class="code" href="class_s_e_root_object.html#a1fa324a207679607c69aa89671b4e3cb">00344</a> <span class="keywordtype">bool</span> <a class="code" href="class_s_e_root_object.html#a1fa324a207679607c69aa89671b4e3cb">SERootObject::is_prop_cached</a>(<span class="keyword">const</span> uint&amp; moduleid, <span class="keyword">const</span> uint&amp; objectid, <span class="keyword">const</span> uint&amp; property_id)
412 <a name="l00345"></a>00345 {
413 <a name="l00346"></a>00346 <span class="preprocessor">#ifndef PROPCACHE_DISABLED         </span>
414 <a name="l00347"></a>00347 <span class="preprocessor"></span>        Sid::Mutex::ScopedLock sl(<a class="code" href="class_s_e_root_object.html#a7db91fa64635d27e17fe5855384a59ae">m_propcache_lock</a>);
415 <a name="l00348"></a>00348         <span class="keywordtype">void</span>* structptr = (<span class="keywordtype">void</span>*)<a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>.<a class="code" href="class_s_e_ptr_int_dict.html#a0bb35ddff347d074e42289a5858984d3">find</a>(objectid);  
416 <a name="l00349"></a>00349 <span class="comment">//         printf(&quot;is_prop_cache oid %u prop %u %p\n&quot;, objectid, property_id, structptr);</span>
417 <a name="l00350"></a>00350         <span class="keywordflow">if</span> (structptr) { 
418 <a name="l00351"></a>00351                 Sid::List_uint* cp = <a class="code" href="class_s_e_root_object.html#ab38292106ac39509a0c2edf6c800a479">prop_cached_list</a>(structptr, moduleid);
419 <a name="l00352"></a>00352                 <span class="keywordflow">return</span> cp-&gt;contains(property_id);               
420 <a name="l00353"></a>00353         }  
421 <a name="l00354"></a>00354 <span class="preprocessor">#endif                </span>
422 <a name="l00355"></a>00355 <span class="preprocessor"></span>        <span class="keywordflow">return</span> <span class="keyword">false</span>;
423 <a name="l00356"></a>00356 }
424 <a name="l00357"></a>00357 
425 <a name="l00358"></a><a class="code" href="class_s_e_root_object.html#a755821fdf0385d3ebaba74e9b9bbd573">00358</a> <span class="keywordtype">void</span> <a class="code" href="class_s_e_root_object.html#a755821fdf0385d3ebaba74e9b9bbd573">SERootObject::del_prop_cached</a>(<span class="keyword">const</span> uint&amp; moduleid, <span class="keyword">const</span> uint&amp; objectid, <span class="keyword">const</span> uint&amp; property_id)
426 <a name="l00359"></a>00359 {
427 <a name="l00360"></a>00360 <span class="preprocessor">#ifndef PROPCACHE_DISABLED</span>
428 <a name="l00361"></a>00361 <span class="preprocessor"></span>        Sid::Mutex::ScopedLock sl(<a class="code" href="class_s_e_root_object.html#a7db91fa64635d27e17fe5855384a59ae">m_propcache_lock</a>); 
429 <a name="l00362"></a>00362         <span class="keywordtype">void</span>* structptr = (<span class="keywordtype">void</span>*)<a class="code" href="class_s_e_root_object.html#affa9317dab644670feef4396a8143154">m_cached_props</a>.<a class="code" href="class_s_e_ptr_int_dict.html#a0bb35ddff347d074e42289a5858984d3">find</a>(objectid);  
430 <a name="l00363"></a>00363 <span class="comment">//         printf(&quot;adding to propcache oid %u prop %u %p\n&quot;, objectid, property_id, structptr); </span>
431 <a name="l00364"></a>00364         <span class="keywordflow">if</span> (structptr) {   
432 <a name="l00365"></a>00365                 Sid::List_uint* cp = <a class="code" href="class_s_e_root_object.html#ab38292106ac39509a0c2edf6c800a479">prop_cached_list</a>(structptr, moduleid);
433 <a name="l00366"></a>00366                 cp-&gt;remove_val(property_id);       
434 <a name="l00367"></a>00367         }
435 <a name="l00368"></a>00368 <span class="preprocessor">#endif                    </span>
436 <a name="l00369"></a>00369 <span class="preprocessor"></span>}
437 <a name="l00370"></a>00370     
438 <a name="l00371"></a>00371 <span class="comment">//------------------------------------------------------------------------------        </span>
439 <a name="l00372"></a>00372         
440 <a name="l00373"></a><a class="code" href="class_s_e_reference.html#a94ecd41dc75218466a142846643ab4af">00373</a> <span class="keywordtype">bool</span> <a class="code" href="class_s_e_reference.html#a94ecd41dc75218466a142846643ab4af">SEReference::present</a>()<span class="keyword"> const</span>
441 <a name="l00374"></a>00374 <span class="keyword"></span>{
442 <a name="l00375"></a>00375         <span class="keywordflow">if</span> (<a class="code" href="class_s_e_reference.html#a4ee338e1badee0a743b3e1092e4aca7c">m_oid</a> == (uint) -1) <span class="keywordflow">return</span> <span class="keyword">false</span>;
443 <a name="l00376"></a>00376         <span class="keywordflow">if</span> (<a class="code" href="class_s_e_reference.html#ac542d3596ea1df7bb8a5b6769ef088e1">m_object</a> == 0 || <a class="code" href="class_s_e_reference.html#ac542d3596ea1df7bb8a5b6769ef088e1">m_object</a>-&gt;<a class="code" href="class_s_e_object.html#a5c3dd621a821a7e075fc4b8f4d7a8622">object_id</a> != <a class="code" href="class_s_e_reference.html#a4ee338e1badee0a743b3e1092e4aca7c">m_oid</a>) {
444 <a name="l00377"></a>00377                 <a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>* <span class="keywordtype">object</span> = <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#a4ed48ad464430a0702839df779807aef">get_object</a>(<a class="code" href="class_s_e_reference.html#a4ee338e1badee0a743b3e1092e4aca7c">m_oid</a>);
445 <a name="l00378"></a>00378                 <span class="keywordflow">if</span> (<span class="keywordtype">object</span>) { <a class="code" href="class_s_e_reference.html#ac542d3596ea1df7bb8a5b6769ef088e1">m_object</a> = object; }
446 <a name="l00379"></a>00379                 <span class="keywordflow">return</span> <span class="keywordtype">object</span> != 0;
447 <a name="l00380"></a>00380         }
448 <a name="l00381"></a>00381         <span class="keywordflow">return</span> <span class="keyword">true</span>;
449 <a name="l00382"></a>00382 }
450 <a name="l00383"></a>00383 
451 <a name="l00384"></a><a class="code" href="class_s_e_reference.html#aab0cb0f13c2617fff727f2f60fe90b1a">00384</a> <a class="code" href="class_s_e_object.html" title="SEObject is a base class for all API modules.">SEObject</a>* <a class="code" href="class_s_e_reference.html#aab0cb0f13c2617fff727f2f60fe90b1a">SEReference::operator-&gt;</a>()<span class="keyword"> const</span>
452 <a name="l00385"></a>00385 <span class="keyword"></span>{
453 <a name="l00386"></a>00386         <span class="keywordflow">if</span> (<a class="code" href="class_s_e_reference.html#a4ee338e1badee0a743b3e1092e4aca7c">m_oid</a> == (uint) -1) <span class="keywordflow">return</span> 0;
454 <a name="l00387"></a>00387         <span class="keywordflow">if</span> (<a class="code" href="class_s_e_reference.html#ac542d3596ea1df7bb8a5b6769ef088e1">m_object</a> == 0 || <a class="code" href="class_s_e_reference.html#ac542d3596ea1df7bb8a5b6769ef088e1">m_object</a>-&gt;<a class="code" href="class_s_e_object.html#a5c3dd621a821a7e075fc4b8f4d7a8622">object_id</a> != <a class="code" href="class_s_e_reference.html#a4ee338e1badee0a743b3e1092e4aca7c">m_oid</a>) {
455 <a name="l00388"></a>00388                 <a class="code" href="class_s_e_reference.html#ac542d3596ea1df7bb8a5b6769ef088e1">m_object</a> = <a class="code" href="class_s_e_root_object.html#aaaca50ca33e9a709dffa61ea92d7e64f">SERootObject::instance</a>()-&gt;<a class="code" href="class_s_e_root_object.html#adf9eda333f39a71bafa68fd916197931">resolve_object</a>(<a class="code" href="class_s_e_reference.html#a4ee338e1badee0a743b3e1092e4aca7c">m_oid</a>, <a class="code" href="class_s_e_reference.html#a7b01577b181c740f0a410bce7da2e2de">m_modid</a>);
456 <a name="l00389"></a>00389         }
457 <a name="l00390"></a>00390         <span class="keywordflow">return</span> <a class="code" href="class_s_e_reference.html#ac542d3596ea1df7bb8a5b6769ef088e1">m_object</a>;
458 <a name="l00391"></a>00391 }            
459 </pre></div></div>
460
461 <hr/>   
462                 <p><b>(c) Skype Technologies S.A. Confidential/Proprietary</b></p>              
463                 <p>Last updated: 18 Jun 2010</p>                
464                 </BODY>
465 </HTML>