本文整理汇总了C++中storage_t类的典型用法代码示例。如果您正苦于以下问题:C++ storage_t类的具体用法?C++ storage_t怎么用?C++ storage_t使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了storage_t类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restore
void cScrollbar::restore(storage_t to) {
cControl::restore(to);
if(to.find("scroll-pos") != to.end())
pos = boost::any_cast<int>(to["scroll-pos"]);
if(to.find("scroll-max") != to.end())
pos = boost::any_cast<int>(to["scroll-max"]);
else pos = 0;
}
示例2: restore
void cScrollPane::restore(storage_t to) {
// We don't call the superclass restore() here like the other controls do
if(to.find("") != to.end())
scroll.restore(boost::any_cast<storage_t>(to[""]));
for(auto& ctrl : contents) {
if(to.find(ctrl.first) != to.end())
ctrl.second->restore(boost::any_cast<storage_t>(to[ctrl.first]));
}
}
示例3: restore
void cTextField::restore(storage_t to) {
cControl::restore(to);
if(to.find("fld-ip") != to.end())
insertionPoint = boost::any_cast<int>(to["fld-ip"]);
else insertionPoint = getText().length();
if(to.find("fld-sp") != to.end())
selectionPoint = boost::any_cast<int>(to["fld-sp"]);
else selectionPoint = 0;
}
示例4: sorted_dumper
// klen: key field length in bits in hash (i.e before rounding up to bytes)
// vlen: value field length in bits
sorted_dumper(uint_t _threads, const char *_file_prefix, size_t _buffer_size,
uint_t _vlen, storage_t *_ary) :
threads(_threads), file_prefix(_file_prefix), buffer_size(_buffer_size),
klen(_ary->get_key_len()), vlen(_vlen), ary(_ary), file_index(0),
tr(), lower_count(0), upper_count(std::numeric_limits<uint64_t>::max()),
one_file(false)
{
key_len = bits_to_bytes(klen);
val_len = bits_to_bytes(vlen);
record_len = key_len + val_len;
nb_records = ary->floor_block(_buffer_size / record_len, nb_blocks);
while(nb_records < ary->get_max_reprobe_offset()) {
nb_records = ary->floor_block(2 * nb_records, nb_blocks);
}
thread_info = new struct thread_info_t[threads];
for(uint_t i = 0; i < threads; i++) {
// thread_info[i].token = i == 0;
thread_info[i].writer.initialize(nb_records, klen, vlen, ary);
thread_info[i].heap.initialize(ary->get_max_reprobe_offset());
thread_info[i].token = tr.new_token();
}
unique = distinct = total = max_count = 0;
}
示例5: storage_unlink
int storage_unlink(storage_t storage, const char *path)
{
return storage->unlink(storage->state, path);
}
示例6: storage_store_buffer
int storage_store_buffer(storage_t storage, const char *path, struct buffer *buffer)
{
return storage->store_buffer(storage->state, path, buffer);
}
示例7: restore
void cLedGroup::restore(storage_t to) {
cControl::restore(to);
if(to.find("led-select") != to.end())
setSelected(boost::any_cast<std::string>(to["led-select"]));
else setSelected("");
}
示例8: clear
void clear()
{
if ( has_value )
{
contained.destruct_value();
contained.construct_error( std::exception_ptr() );
}
has_value = false;
}
示例9: clear
void clear()
{
if ( has_value )
{
contained.destruct_value();
contained.construct_error( error_type() );
}
has_value = false;
}
示例10: swap
void swap( expected & rhs )
{
using std::swap;
if ( has_value == true && rhs.has_value == true ) { swap( contained.value(), rhs.contained.value() ); }
else if ( has_value == false && rhs.has_value == false ) { swap( contained.error(), rhs.contained.error() ); }
else if ( has_value == false && rhs.has_value == true ) { rhs.swap( *this ); }
else if ( has_value == true && rhs.has_value == false ) { error_type t = rhs.contained.error();
rhs.contained.destruct_error();
rhs.contained.construct_value( contained.value() );
contained.construct_error( t );
swap( has_value, rhs.has_value );
}
}
示例11:
al_graph(std::initializer_list<nodeid_t> const& list)
: has_mark(false)
{
std::for_each(list.begin(), list.end(),
[&](nodeid_t id) {
_data.insert({id, node_t{id}});
});
}
示例12: begin
iterator begin() {
return _data.begin();
}
示例13: initialize_value
void initialize_value( V const & v )
{
assert( ! has_value );
contained.construct_value( v );
has_value = true;
}
示例14: expected
expected()
: has_value( false )
{
contained.construct_error( error_type() );
}
示例15: error
error_type const & error() const
{
return has_value ? (throw nonstd::bad_expected_access("expected: no contained error"), contained.error() ) : contained.error();
}