Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
Ase::WritNode Class Reference

One entry in a Writ serialization document. More...

#include "serialize.hh"

Public Member Functions

 WritNode (Writ &writ, ValueP vp=std::make_shared< Value >(Value::empty_value))
 
WritNode operator[] (const String &fieldname)
 
WritNode front (const String &fieldname)
 
bool in_load () const
 Return true during deserialization.
 
bool in_save () const
 Return true during serialization.
 
bool skip_emptystring () const
 Omit empty strings during in_save()
 
bool skip_zero () const
 Omit zero integers or floats during in_save()
 
Writwrit ()
 Access the Writ of this node.
 
Valuevalue ()
 Access the Value of this node.
 
void purge_value ()
 Clean up defaults in Value.
 
Value::Type index () const
 
size_t count () const
 
int64 as_int () const
 
double as_double () const
 
String as_string () const
 
WritNodeS to_nodes ()
 Create std::vector<WritNode> for serialized arrays during in_load().
 
WritNode push ()
 Append new WritNode for serializing arrays during in_save().
 
String repr () const
 
StringS keys () const
 
bool has (const String &key) const
 
bool loadable (const String &key) const
 True if in_load() && has (key).
 
template<typename T >
bool operator<< (const T &v)
 
template<typename T >
bool operator>> (T &v)
 
template<typename T >
bool operator& (T &v)
 Serialization operator.
 
bool operator& (const WritLink &l)
 Write an object link during saving, queue a deferred pointer during loading.
 
template<class T , class E = void>
bool serialize (T &, const String &="", const StringS &=StringS())
 
template<class T >
bool serialize (std::vector< T > &vec, const String &="", const StringS &=StringS())
 
bool serialize (ValueS &vec, const String &="", const StringS &=StringS())
 
bool serialize (ValueR &rec, const String &="", const StringS &=StringS())
 
bool serialize (Value &val, const String &="", const StringS &=StringS())
 
bool serialize (Serializable &sobj)
 
template<class ... T>
bool serialize (std::tuple< T... > &tup, const String &="", const StringS &=StringS())
 
template<>
bool serialize (String &string, const String &fieldname, const StringS &typedata)
 

Friends

class Writ
 

Detailed Description

One entry in a Writ serialization document.

Definition at line 24 of file serialize.hh.

Constructor & Destructor Documentation

◆ WritNode()

Ase::WritNode::WritNode ( Writ writ,
ValueP  vp = std::make_shared<Value> (Value::empty_value) 
)

Definition at line 242 of file serialize.cc.

Member Function Documentation

◆ as_double()

double Ase::WritNode::as_double ( ) const

Definition at line 45 of file serialize.hh.

◆ as_int()

int64 Ase::WritNode::as_int ( ) const

Definition at line 44 of file serialize.hh.

◆ as_string()

String Ase::WritNode::as_string ( ) const

Definition at line 46 of file serialize.hh.

◆ count()

size_t Ase::WritNode::count ( ) const

Definition at line 43 of file serialize.hh.

◆ front()

WritNode Ase::WritNode::front ( const String fieldname)

Definition at line 34 of file serialize.hh.

◆ has()

bool Ase::WritNode::has ( const String key) const

Definition at line 51 of file serialize.hh.

◆ in_load()

bool Ase::WritNode::in_load ( ) const

◆ in_save()

bool Ase::WritNode::in_save ( ) const

◆ index()

Value::Type Ase::WritNode::index ( ) const

Definition at line 42 of file serialize.hh.

◆ keys()

StringS Ase::WritNode::keys ( ) const

Definition at line 50 of file serialize.hh.

◆ loadable()

bool Ase::WritNode::loadable ( const String key) const

True if in_load() && has (key).

Definition at line 211 of file serialize.hh.

References in_load().

◆ operator&() [1/2]

bool Ase::WritNode::operator& ( const WritLink l)

Write an object link during saving, queue a deferred pointer during loading.

Definition at line 306 of file serialize.cc.

References Ase::Value::as_int(), in_load(), in_save(), and std::vector::push_back().

◆ operator&() [2/2]

template<typename T >
bool Ase::WritNode::operator& ( T &  v)

Serialization operator.

Definition at line 218 of file serialize.hh.

◆ operator<<()

template<typename T >
bool Ase::WritNode::operator<< ( const T &  v)

Definition at line 224 of file serialize.hh.

◆ operator>>()

template<typename T >
bool Ase::WritNode::operator>> ( T &  v)

Definition at line 232 of file serialize.hh.

◆ operator[]()

WritNode Ase::WritNode::operator[] ( const String fieldname)

Definition at line 33 of file serialize.hh.

◆ purge_value()

void Ase::WritNode::purge_value ( )

Clean up defaults in Value.

Definition at line 354 of file serialize.cc.

References Ase::Value::filter(), return_unless, skip_emptystring(), and skip_zero().

◆ push()

WritNode Ase::WritNode::push ( )

Append new WritNode for serializing arrays during in_save().

Definition at line 285 of file serialize.cc.

References assert_return, std::vector::back(), and in_save().

Referenced by Ase::ClipImpl::serialize(), Ase::NativeDeviceImpl::serialize(), and Ase::TrackImpl::serialize().

◆ repr()

String Ase::WritNode::repr ( ) const

Definition at line 49 of file serialize.hh.

◆ serialize() [1/8]

bool Ase::WritNode::serialize ( Serializable sobj)

Definition at line 331 of file serialize.cc.

◆ serialize() [2/8]

template<class ... T>
bool Ase::WritNode::serialize ( std::tuple< T... > &  tup,
const String fieldname = "",
const StringS typedata = StringS() 
)

Definition at line 298 of file serialize.hh.

◆ serialize() [3/8]

template<class T >
bool Ase::WritNode::serialize ( std::vector< T > &  vec,
const String fieldname = "",
const StringS typedata = StringS() 
)

Definition at line 266 of file serialize.hh.

◆ serialize() [4/8]

template<>
bool Ase::WritNode::serialize ( String string,
const String fieldname,
const StringS typedata 
)

Definition at line 250 of file serialize.hh.

◆ serialize() [5/8]

template<typename T , typename >
bool Ase::WritNode::serialize ( T &  typval,
const String fieldname = "",
const StringS typedata = StringS() 
)

Definition at line 240 of file serialize.hh.

◆ serialize() [6/8]

bool Ase::WritNode::serialize ( Value val,
const String fieldname = "",
const StringS typedata = StringS() 
)

Definition at line 336 of file serialize.hh.

◆ serialize() [7/8]

bool Ase::WritNode::serialize ( ValueR rec,
const String fieldname = "",
const StringS typedata = StringS() 
)

Definition at line 369 of file serialize.hh.

◆ serialize() [8/8]

bool Ase::WritNode::serialize ( ValueS vec,
const String fieldname = "",
const StringS typedata = StringS() 
)

Definition at line 352 of file serialize.hh.

◆ skip_emptystring()

bool Ase::WritNode::skip_emptystring ( ) const

Omit empty strings during in_save()

Definition at line 187 of file serialize.hh.

Referenced by purge_value().

◆ skip_zero()

bool Ase::WritNode::skip_zero ( ) const

Omit zero integers or floats during in_save()

Definition at line 193 of file serialize.hh.

Referenced by purge_value().

◆ to_nodes()

WritNodeS Ase::WritNode::to_nodes ( )

◆ value()

Value & Ase::WritNode::value ( )

Access the Value of this node.

Definition at line 199 of file serialize.hh.

Referenced by Ase::ClipImpl::serialize().

◆ writ()

Writ & Ase::WritNode::writ ( )

Access the Writ of this node.

Definition at line 205 of file serialize.hh.

Friends And Related Symbol Documentation

◆ Writ

friend class Writ
friend

Definition at line 28 of file serialize.hh.


The documentation for this class was generated from the following files: