1 #ifndef CNOID_UTIL_ARCHIVE_SESSION_H
2 #define CNOID_UTIL_ARCHIVE_SESSION_H
7 #include "exportdecl.h"
24 bool addReference(
const Uuid& uuid,
Referenced*
object,
bool doUnreferenceImmediately =
false);
26 template<
class ObjectType>
29 std::function<
bool(ObjectType*
object,
bool isImmediate)> onResolved,
30 std::function<
bool()> onNotResolved =
nullptr)
34 [onResolved](
Referenced*
object,
bool isImmediate){
35 if(
auto derived =
dynamic_cast<ObjectType*
>(
object)){
36 return onResolved(derived, isImmediate);
44 template<
class ObjectType>
47 std::function<
bool(ObjectType*
object)> onResolved,
48 std::function<
bool()> onNotResolved =
nullptr)
52 [onResolved](
Referenced*
object,
bool isImmediate){
53 if(
auto derived =
dynamic_cast<ObjectType*
>(
object)){
54 return onResolved(derived);
62 virtual void putWarning(
const std::string& message);
63 virtual void putError(
const std::string& message);
65 void resolvePendingReferences();
70 void resolveReference_(
72 std::function<
bool(
Referenced*
object,
bool isImmediate)> onResolved,
73 std::function<
bool()> onNotResolved,