本文整理汇总了C++中boost::serialization::nvp::value方法的典型用法代码示例。如果您正苦于以下问题:C++ nvp::value方法的具体用法?C++ nvp::value怎么用?C++ nvp::value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::serialization::nvp
的用法示例。
在下文中一共展示了nvp::value方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
void operator () (Archive& ar,
const boost::serialization::nvp<T>& data,
const unsigned int version)
{
// Drop the name
ar << data.value();
}
示例2: load_override
void load_override(
const boost::serialization::nvp< T > & t
){
load_start(t.name());
archive::load(* this->This(), t.value());
load_end(t.name());
}
示例3: load_override
void load_override(
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const
#endif
boost::serialization::nvp< boost::serialization::collection_size_type > &t,
int
)
{
std::string itemName = m_currentName;
std::string cap;
unsigned counter = 0;
m_collectionStart = true;
m_collectionEnd = false;
m_collectionStream << "<item_version>0</item_version>";
while (true)
{
*this >> boost::serialization::make_nvp(itemName.c_str(), cap);
if (m_collectionEnd)
break;
m_collectionStream << "<item>" << cap << "</item>";
counter++;
}
t.value() = counter;
m_collectionSize = counter + 1; // +1 as the same loop sequence will parse item_version
m_collection = std::make_unique<ws_xml_iarchive>(m_collectionStream);
}
示例4: load_override
void load_override(const boost::serialization::nvp< std::vector<value_type, allocator_type> > data, int)
{
token type = input.type();
if (type == token_array_begin)
{
scope_stack.push(scope(type));
input.next();
while (true)
{
type = input.type();
if (type == token_array_end)
{
if (scope_stack.top().group == token_array_begin)
{
scope_stack.pop();
}
else
{
goto error;
}
break;
}
else if ((type == token_eof) || (type == token_error))
{
goto error;
}
else
{
value_type item;
*this >> boost::serialization::make_nvp(data.name(), item);
data.value().push_back(item);
}
}
}
示例5: load_override
void ws_xml_iarchive::load_override(
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const
#endif
boost::serialization::nvp< bool > & t, int){
std::string str;
base::load_override(boost::serialization::make_nvp<std::string>(t.name(), str), 0);
t.value() = (str == "true");
}
示例6: load_override
void load_override(
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const
#endif
boost::serialization::nvp<T> & t,
int
){
load_start(t.name());
archive::load(* this->This(), t.value());
load_end(t.name());
}
示例7: load_override
void load_override(
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const
#endif
boost::serialization::nvp<T> & t,
int
){
this->This()->load_start(t.name());
this->detail_common_iarchive::load_override(t.value(), 0);
this->This()->load_end(t.name());
}
示例8: load_override
void load_override(const boost::serialization::nvp<T> & t, int){
T& x(t.value());
* this >> x;
}
示例9: load_override
void json_iarchive::load_override(boost::serialization::nvp<boost::serialization::collection_size_type> const& t, int) {
load_override(t.value(), 0);
}
示例10: save_override
void save_override(const ::boost::serialization::nvp<T> & t, int)
{
this->This()->save_start(t.name());
archive::save(* this->This(), t.value());
this->This()->save_end(t.name());
}