本文整理汇总了C++中storage_type类的典型用法代码示例。如果您正苦于以下问题:C++ storage_type类的具体用法?C++ storage_type怎么用?C++ storage_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了storage_type类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: serialize
void serialize(storage_type& s) const
{
s.serialize(mFirstX);
s.serialize(mXW);
s.serialize(mW);
s.serialize(mXXW);
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:7,代码来源:StatisticsAccumulator.hpp
示例2: serialize
static void serialize(storage_type& s, const Nullable<T>& in)
{
bool is = in.isValue();
s.serialize(is);
if (is)
s.serialize(*in);
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:7,代码来源:Nullable.hpp
示例3: deserialize
void deserialize(storage_type& s)
{
s.deserialize(mFirstX);
s.deserialize(mXW);
s.deserialize(mW);
s.deserialize(mXXW);
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:7,代码来源:StatisticsAccumulator.hpp
示例4: serialize
static void serialize(storage_type& s, const boost::unordered_set<T>& o)
{
uint32_t sz = o.size();
s.serialize(sz);
for (auto it = o.begin(), it_end = o.end(); it != it_end; ++it)
s.serialize(*it);
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:8,代码来源:BoostContainerSerializers.hpp
示例5: serialize
static void serialize(storage_type& s, const Alternative<T1, T2>& in)
{
s.serialize(in.isLeft());
if (in.isLeft())
s.serialize(in.left());
else
s.serialize(in.right());
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:8,代码来源:Alternative.hpp
示例6: serialize
static void serialize(storage_type& s, const MapWithIndex<T1, T2, cmp_type_1, cmp_type_2>& o)
{
uint32_t sz = o.size();
s.serialize(sz);
for (auto it = o.getKeyToValue().begin(), it_end = o.getKeyToValue().end();
it != it_end; ++it)
{
s.serialize(it->first);
s.serialize(it->second);
}
}
开发者ID:vishnur,项目名称:ufora,代码行数:12,代码来源:MapWithIndex.hpp
示例7: deserialize
static void deserialize(storage_type& s, boost::unordered_set<T>& o)
{
o = boost::unordered_set<T>();
uint32_t sz;
s.deserialize(sz);
for (int32_t k = 0; k < sz; k++)
{
T key;
s.deserialize(key);
o.insert(key);
}
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:13,代码来源:BoostContainerSerializers.hpp
示例8: deserialize
static void deserialize(storage_type& s, Nullable<T>& out)
{
bool n;
s.deserialize(n);
if (n)
{
T t;
s.deserialize(t);
out = t;
}
else
out = null();
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:13,代码来源:Nullable.hpp
示例9: indexmap_storage_pair
indexmap_storage_pair (const indexmap_type & IM, const storage_type & ST):
indexmap_(IM),storage_(ST){
#ifdef TRIQS_ARRAYS_CHECK_IM_STORAGE_COMPAT
if (ST.size() != IM.domain().number_of_elements())
TRIQS_RUNTIME_ERROR<<"index_storage_pair construction : storage and indices are not compatible";
#endif
}
开发者ID:panaceamee,项目名称:TRIQS,代码行数:7,代码来源:indexmap_storage_pair.hpp
示例10: deserialize
static void deserialize(storage_type& s, MapWithIndex<T1, T2, cmp_type_1, cmp_type_2>& o)
{
o = MapWithIndex<T1,T2, cmp_type_1, cmp_type_2>();
uint32_t sz;
s.deserialize(sz);
for (uint32_t k = 0; k < sz; k++)
{
T1 key;
T2 val;
s.deserialize(key);
s.deserialize(val);
o.set(key,val);
}
}
开发者ID:vishnur,项目名称:ufora,代码行数:16,代码来源:MapWithIndex.hpp
示例11: deserialize
static void deserialize(storage_type& s, Alternative<T1, T2>& in)
{
bool isLeft;
s.deserialize(isLeft);
if (isLeft)
{
T1 t1;
s.deserialize(t1);
in = Alternative<T1, T2>(t1);
}
else
{
T2 t2;
s.deserialize(t2);
in = Alternative<T1, T2>(t2);
}
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:17,代码来源:Alternative.hpp
示例12: get
/**
* gets the value associated with a key.
* Returns (true, Value) if the entry is available.
* Returns (false, undefined) otherwise.
*/
std::pair<bool, ValueType> get(const KeyType &key) const {
// who owns the data?
const size_t hashvalue = hasher(key);
const size_t owningmachine = hashvalue % rpc.numprocs();
std::pair<bool, ValueType> retval;
// if it is me, we can return it
if (owningmachine == rpc.dc().procid()) {
lock.lock();
typename storage_type::const_iterator iter = storage.find(hashvalue);
retval.first = iter != storage.end();
if (retval.first) retval.second = iter->second;
lock.unlock();
} else {
retval = rpc.remote_request(owningmachine,
&dht<KeyType,ValueType>::get,
key);
}
return retval;
}
开发者ID:jerrylam,项目名称:GraphLab,代码行数:26,代码来源:dht.hpp
示例13: init
static void init(storage_type& storage,rvalue_source_type t)
{
storage.reset(new T(static_cast<rvalue_source_type>(t)));
}
开发者ID:rjpower,项目名称:boost-fiber,代码行数:4,代码来源:future.hpp
示例14: cleanup
static void cleanup(storage_type& storage)
{
storage.reset();
}
开发者ID:rjpower,项目名称:boost-fiber,代码行数:4,代码来源:future.hpp
示例15: get_pointer
static pointer get_pointer(index_type i, storage_type& stg)
{
pointer p=stg.end();
p.set_address(i);
return p;
}
开发者ID:mambaru,项目名称:v-set,代码行数:6,代码来源:hitlist5.cpp
示例16: eval
EvalType eval()
{
EvalType prod(1);
iterator end_it(prime_factors.end());
for (iterator it(prime_factors.begin()); it != end_it; it++)
{
if (it->second)
{
if (it->second > 0)
prod *= gsse::slow_power(it->first, it->second);
else
prod /= gsse::slow_power(it->first, -it->second);
}
}
return prod;
}
开发者ID:AlexanderToifl,项目名称:viennamesh-dev,代码行数:17,代码来源:factorial.hpp
示例17: end
const_iterator end() const
{
return const_iterator( storage.end(), storage.end() );
}
开发者ID:cctbx,项目名称:cctbx-playground,代码行数:4,代码来源:flattening.hpp
示例18: begin
const_iterator begin() const
{
return const_iterator( storage.begin(), storage.end() );
}
开发者ID:cctbx,项目名称:cctbx-playground,代码行数:4,代码来源:flattening.hpp
示例19: destroy
void destroy() { static_cast< T* >(storage.address())->~T(); }
开发者ID:Icenium,项目名称:BoostSharp,代码行数:1,代码来源:threadsafe_queue.hpp
示例20: value
T& value() { return *static_cast< T* >(storage.address()); }
开发者ID:Icenium,项目名称:BoostSharp,代码行数:1,代码来源:threadsafe_queue.hpp
注:本文中的storage_type类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论