Project Chrono: chrono::ChFunctorArchiveIn Class Reference

Public Member Functions | List of all members
chrono::ChFunctorArchiveIn Class Referenceabstract
Chrono::Engine » Serialization

## Description

Functor to call the ArchiveIn function for unrelated classes that implemented them.

This helps stripping out the templating, to make ChArchiveIn easier and equippable with virtual functions.

`#include <ChArchive.h>`

## Public Member Functions
virtual void | CallArchiveIn (ChArchiveIn &archive_in, const std::string &classname)=0
| Use this to call member function ArchiveIn.
virtual void | CallArchiveIn (ChArchiveIn &archive_in)=0
virtual void | CallConstructor (ChArchiveIn &archive_in, const std::string &classname)=0
| Use this to call.
virtual void | CallConstructorDefault (const std::string &classname)=0
| Use this to create a new object as pt2Object = new myclass(), but using the class factory for polymorphic classes.
virtual void | SetRawPtr (void *mptr)=0
| Set the pointer (use static_cast).
virtual void * | GetRawPtr ()=0
| Get the pointer (use static_cast).
virtual bool | IsPolymorphic ()=0
| Tell if the pointed object is polymorphic.
virtual std::type_index | GetObjectPtrTypeindex ()=0
| Get the classname of the object holding the ArchiveIn function.

## Member Function Documentation

## ◆ CallConstructor()

virtual void chrono::ChFunctorArchiveIn::CallConstructor | ( | ChArchiveIn & | archive_in,
|  | const std::string & | classname )
| pure virtual

Use this to call.

- the default constructor, or,
- the constructor embedded in an (optional) static member function ArchiveInConstructor, if implemented The latter is expected to a) deserialize constructor parameters, b) create a new obj as pt2Object = new myclass(params..). If classname not registered, call default constructor via new(T) or call construction via T::ArchiveInConstructor()

## ◆ CallConstructorDefault()

virtual void chrono::ChFunctorArchiveIn::CallConstructorDefault | ( | const std::string & | classname | ) |
| pure virtual

Use this to create a new object as pt2Object = new myclass(), but using the class factory for polymorphic classes.

If classname not registered, creates simply via new(T).

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

- D:/W/B/src/chrono-9.0.1/src/chrono/serialization/ChArchive.h