{ "format": 1, "id": "saw-data_server-loopback", "kind": "class", "name": "data_server", "namespace": "saw", "module": "remote", "header": "modules/remote/c++/transfer_loopback.hpp", "is_special": true, "specializes": "saw-data_server", "arguments": ["Schema", "Encoding", "rmt::Loopback"], "brief_description": "Keeps the values of one schema in a map in this process.", "detailed_description": [ [ "Registers itself with its", {"name": "remote", "id": "saw-remote-loopback"}, "on construction and deregisters on destruction, so its lifetime is what a client sees as the server being reachable." ], [ "Ids are owned by the server, since it is the only instance which knows about every client." ] ], "templates": [ {"name": "Schema", "kind": "type"}, {"name": "Encoding", "kind": "type"} ], "attributes": { "saw-data_server-loopback-class_id": { "id": "saw-data_server-loopback-class_id", "name": "class_id", "type": ["std::pair< uint32_t, uint32_t >"], "visibility": "public", "static": true, "constexpr": true, "initializer": "{schema_hash::apply(), schema_hash::apply()}", "brief_description": "Unique key for identifying an underlying data type without using typeid." }, "saw-data_server-loopback-values_": { "id": "saw-data_server-loopback-values_", "name": "values_", "type": ["std::unordered_map< uint64_t, data< Schema, Encoding > >"], "visibility": "private" }, "saw-data_server-loopback-next_id_": { "id": "saw-data_server-loopback-next_id_", "name": "next_id_", "type": ["uint64_t"], "visibility": "private", "initializer": "0u", "brief_description": "Counter for handing out ids." } }, "functions": { "saw-data_server-loopback-get_class_id": { "id": "saw-data_server-loopback-get_class_id", "name": "get_class_id", "type": ["std::pair< uint32_t, uint32_t >"], "const": true, "override": true, "brief_description": "Returns the schema id." }, "saw-data_server-loopback-next_free_id": { "id": "saw-data_server-loopback-next_free_id", "name": "next_free_id", "type": ["id< Schema >"], "brief_description": "Hands out the next id which is not in use yet.", "detailed_description": [ [ "The id is not reserved by this call. It is only in use once something is stored under it, so two calls without a store in between return the same id." ] ] }, "saw-data_server-loopback-send-1": { "id": "saw-data_server-loopback-send-1", "name": "send", "type": ["error_or< void >"], "brief_description": "Stores a value under an id without taking over the source.", "detailed_description": [ ["Fails with already_exists if the id is taken."] ], "parameters": [ {"name": "dat", "type": ["ref< data< Schema, Encoding > >"]}, {"name": "store_id", "type": ["id< Schema >"]} ] }, "saw-data_server-loopback-send-2": { "id": "saw-data_server-loopback-send-2", "name": "send", "type": ["error_or< void >"], "brief_description": "Stores a value under an id, taking it over.", "detailed_description": [ ["Fails with already_exists if the id is taken."] ], "parameters": [ {"name": "dat", "type": ["data< Schema, Encoding >"]}, {"name": "store_id", "type": ["id< Schema >"]} ] }, "saw-data_server-loopback-allocate": { "id": "saw-data_server-loopback-allocate", "name": "allocate", "type": ["error_or< void >"], "brief_description": "Reserves storage described by the meta schema without sending a value.", "detailed_description": [ [ "The counterpart to sending for backends where the output has to exist before it is written, such as a device buffer." ] ], "parameters": [ { "name": "meta", "type": ["data< typename meta_schema< Schema >::MetaSchema, Encoding >"], "brief_description": "Dimensions and whatever else the schema needs to exist." }, {"name": "store_id", "type": ["id< Schema >"]} ] }, "saw-data_server-loopback-receive": { "id": "saw-data_server-loopback-receive", "name": "receive", "type": ["error_or< data< Schema, Encoding > >"], "brief_description": "Returns a copy of the value stored under an id.", "detailed_description": [ ["Fails with not_found if nothing is stored under that id."] ], "parameters": [ {"name": "store_id", "type": ["id< Schema >"]} ] }, "saw-data_server-loopback-erase": { "id": "saw-data_server-loopback-erase", "name": "erase", "type": ["error_or< void >"], "brief_description": "Drops the value stored under an id.", "detailed_description": [ ["Fails with not_found if nothing is stored under that id."] ], "parameters": [ {"name": "store_id", "type": ["id< Schema >"]} ] }, "saw-data_server-loopback-find": { "id": "saw-data_server-loopback-find", "name": "find", "type": ["error_or< ptr< data< Schema, Encoding > > >"], "brief_description": "Returns a pointer to the stored value itself.", "detailed_description": [ [ "An exception for this backend. Only meaningful because the data is in process, and a store may invalidate the pointer." ], [ "The", {"name": "rpc_server", "id": "saw-rpc_server-loopback"}, "uses it to hand a parameter to an interface function without copying it out of the server first." ] ], "parameters": [ {"name": "store_id", "type": ["id< Schema >"]} ] } }, "notes": [ "Copy and move are forbidden, because the remote holds a pointer to this object while it is registered." ] }