Turi Create  4.0
cppipc::object_factory_impl Class Reference

#include <core/system/cppipc/common/object_factory_impl.hpp>

Public Member Functions

size_t make_object (std::string object_type_name)
 
void delete_object (size_t object_id)
 
std::string ping (std::string pingval)
 
std::string get_status_publish_address ()
 
std::string get_control_address ()
 
void sync_objects (std::vector< size_t > object_ids, bool input_sorted)
 
void add_constructor (std::string object_type_name, std::function< std::shared_ptr< void >()> constructor)
 

Detailed Description

An implementation of the object factory interface. This is a special object created by the comm_server and is used to provide the comm_server with an external interface; for instance to manage the construction and destruction of objects

Definition at line 26 of file object_factory_impl.hpp.

Member Function Documentation

◆ add_constructor()

void cppipc::object_factory_impl::add_constructor ( std::string  object_type_name,
std::function< std::shared_ptr< void >()>  constructor 
)
inline

Stores a constructor for an object type

Definition at line 64 of file object_factory_impl.hpp.

◆ delete_object()

void cppipc::object_factory_impl::delete_object ( size_t  object_id)
virtual

Deletes the object of type object_id

Implements cppipc::object_factory_base.

◆ get_control_address()

std::string cppipc::object_factory_impl::get_control_address ( )
virtual

Get the address which the server is receiving control messages

Implements cppipc::object_factory_base.

◆ get_status_publish_address()

std::string cppipc::object_factory_impl::get_status_publish_address ( )
virtual

Get the address on which the server is publishing status updates.

Implements cppipc::object_factory_base.

◆ make_object()

size_t cppipc::object_factory_impl::make_object ( std::string  object_type_name)
virtual

creates and registers an object of type object_type_name

Implements cppipc::object_factory_base.

◆ ping()

std::string cppipc::object_factory_impl::ping ( std::string  pingval)
virtual

Ping test. Replies with the ping value

Implements cppipc::object_factory_base.

◆ sync_objects()

void cppipc::object_factory_impl::sync_objects ( std::vector< size_t >  object_ids,
bool  active_list 
)
virtual

Takes a list of active objects on the client side and garbage collects the objects on the server that are now unused by the client.

If active_list is true, the object_ids refer to the list of objects that are still active: in other words, the server should delete any objects that are not in the active_list.

If active_list is false, the object_ids refer to the list of objects that are no longer active: in other words, the server should delete any objects that are in the active list

Implements cppipc::object_factory_base.


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