Abstract interface for file-like objects. More...
#include <eVision/Easy/ESerializer.h>
Public Member Functions | |
| virtual | ~ESerializer () throw () |
| virtual eVision::ESerializerMode | GetMode () const =0 |
| The current mode of the serializer. | |
| virtual void | Close () |
| Closes the ESerializer object and frees any underlying ressource it could have reserved. | |
| virtual bool | GetClosed () const =0 |
| Indicates if the ESerializer is closed or not. | |
| virtual bool | GetWriting () const |
| Returns true if the ESerializer object has been created for writing and false otherwise. | |
| ESerializer (CppWrapperInternal::InternalConstructor) | |
Static Public Member Functions | |
| static std::unique_ptr< eVision::ESerializer > | CreateFileWriter (const std::string &filePath, eVision::ESerializerFileWriterMode mode) |
| Returns an ESerializer object suitable for opening a file and writing into it. | |
| static std::unique_ptr< eVision::ESerializer > | CreateFileWriter (const std::string &filePath) |
| Returns an ESerializer object suitable for opening a file and writing into it. | |
| static std::unique_ptr< eVision::ESerializer > | CreateFileReader (const std::string &filePath) |
| Returns an ESerializer object suitable for reading from a file. | |
| static std::unique_ptr< eVision::ESerializer > | CreateMemoryWriter () |
| Returns an ESerializer object suitable for serializing into a buffer. | |
| static std::unique_ptr< eVision::ESerializer > | CreateMemoryWriter (uint32_t initialBufferSize) |
| Returns an ESerializer object suitable for serializing into a buffer. | |
| static std::unique_ptr< eVision::ESerializer > | CreateMemoryWriter (void *buffer, uint32_t size) |
| Returns an ESerializer object suitable for serializing into a buffer. | |
| static std::unique_ptr< eVision::ESerializer > | CreateMemoryReader (void *buffer, uint32_t size) |
| Returns an ESerializer object suitable for reading from a buffer. | |
| static std::unique_ptr< eVision::ESerializer > | CreateMemoryReader (const std::vector< uint8_t > &bytes) |
| Returns an ESerializer object suitable for reading from a buffer. | |
| static std::unique_ptr< eVision::ESerializer > | CreateCallbackWriter (void *isEOS, void *setCurrentPos, void *getCurrentPos, void *serializeMemory, void *close, void *cookie) |
| static std::unique_ptr< eVision::ESerializer > | CreateCallbackReader (void *isEOS, void *setCurrentPos, void *getCurrentPos, void *serializeMemory, void *close, void *cookie) |
Public Attributes | |
| CppWrapperInternal::WrappedClass | wrappedClass_ |
Abstract interface for file-like objects.
The ESerializer object manages operations of reading from and writing to an archive (a file on the system hard disk, for instance). ESerializer objects cannot be instantiated directly. To create an ESerializer object, one of the following static factory methods has to be used:
License(s): None
|
virtual | ||||||||||||
| eVision::ESerializer::ESerializer | ( | CppWrapperInternal::InternalConstructor | ) |
|
virtual |
Closes the ESerializer object and frees any underlying ressource it could have reserved.
This method is always called implicitly during the destruction of the object. It is still recommended to call it explicitly in programming languages other than C++ to ensure the underlying ressources are correctly released.
This method never throws exceptions.
Reimplemented in eVision::ECallbackSerializer, eVision::EFileSerializer, and eVision::EMemorySerializer.
|
static |
|
static |
|
static |
Returns an ESerializer object suitable for reading from a file.
| filePath | Full path and name specification of the file to be used to create the ESerializer object. |
If the call does not succeed, it returns NULL. Please check the eVision error code to get further informations.
Call to ESerializer::Close is mandatory after usage to ensure the file handle used by this object is properly released.
Instantiate directly EFileSerializer using its constructor instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
|
static |
Returns an ESerializer object suitable for opening a file and writing into it.
| filePath | Full path and name specification of the file to be used to create the ESerializer object. |
The ESerializerFileWriterMode parameter is an enumerated type that allows to control what happens when the file already exists:
If the call does not succeed, it returns NULL. Please check the eVision error code to get further information.
Call to ESerializer::Close is mandatory after usage to ensure the file handle used by this object is properly released.
Instantiate directly EFileSerializer using its constructor instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
|
static |
Returns an ESerializer object suitable for opening a file and writing into it.
| filePath | Full path and name specification of the file to be used to create the ESerializer object. |
| mode | Creation mode of the storage file, as defined by ESerializerFileWriterMode (by default, Overwrite). |
The ESerializerFileWriterMode parameter is an enumerated type that allows to control what happens when the file already exists:
If the call does not succeed, it returns NULL. Please check the eVision error code to get further information.
Call to ESerializer::Close is mandatory after usage to ensure the file handle used by this object is properly released.
Instantiate directly EFileSerializer using its constructor instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
|
static |
Returns an ESerializer object suitable for reading from a buffer.
| bytes | A vector containing a list of bytes to read. |
Those bytes will be copied into the returned object's internal buffer.
It is up to users to delete the ESerializer object when they have done using it in Load calls.
Instantiate directly a EMemorySerializer using its constructor instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
|
static |
Returns an ESerializer object suitable for reading from a buffer.
| buffer | Address of an external buffer to be used by the memory serializer. |
Those bytes will be copied into the returned object's internal buffer.
| size | Size of the external buffer. |
It is up to users to delete the ESerializer object when they have done using it in Load calls.
Instantiate directly a EMemorySerializer using its constructor instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
|
static |
Returns an ESerializer object suitable for serializing into a buffer.
If a buffer is not provided, a buffer will be automatically created and managed internally by the object.
Please note that, in this case, if you didn't provide a size, the buffer will be automatically resized as needed.
It is up to users to delete the ESerializer object when they have done using it in Save calls.
The returned serializer underlying type is EMemorySerializer, for more information, see the class documentation.
Instantiate directly EMemorySerializer using its constructor instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
|
static |
Returns an ESerializer object suitable for serializing into a buffer.
| initialBufferSize | Size to which allocate the buffer used internally by the memory serializer. |
If a buffer is not provided, a buffer will be automatically created and managed internally by the object.
Please note that, in this case, if you didn't provide a size, the buffer will be automatically resized as needed.
It is up to users to delete the ESerializer object when they have done using it in Save calls.
The returned serializer underlying type is EMemorySerializer, for more information, see the class documentation.
Instantiate directly EMemorySerializer using its constructor instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
|
static |
Returns an ESerializer object suitable for serializing into a buffer.
| buffer | Address of the buffer to be used by the memory serializer. |
| size | Size of the buffer to be used by the memory serializer. |
If a buffer is not provided, a buffer will be automatically created and managed internally by the object.
Please note that, in this case, if you didn't provide a size, the buffer will be automatically resized as needed.
It is up to users to delete the ESerializer object when they have done using it in Save calls.
The returned serializer underlying type is EMemorySerializer, for more information, see the class documentation.
Instantiate directly EMemorySerializer using its constructor instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
|
pure virtual |
Indicates if the ESerializer is closed or not.
Implemented in eVision::ECallbackSerializer, eVision::EFileSerializer, and eVision::EMemorySerializer.
|
pure virtual |
The current mode of the serializer.
Implemented in eVision::ECallbackSerializer, eVision::EFileSerializer, and eVision::EMemorySerializer.
|
virtual |
Returns true if the ESerializer object has been created for writing and false otherwise.
Use ESerializer::GetMode instead.
Deprecated in version 25.2. Scheduled to be removed in version 27.6.
Reimplemented in eVision::EFileSerializer.
| CppWrapperInternal::WrappedClass eVision::ESerializer::wrappedClass_ |