|
SimGrid
3.17
Versatile Simulation of Distributed Systems
|
A simulated file.
Used to simulate the time it takes to access to a file, but does not really store any information.
They are located on simgrid::s4u::Storage that are accessed from a given simgrid::s4u::Host through mountpoints. For now, you cannot change the mountpoints programatically, and must declare them from your platform file.
#include <File.hpp>
Public Member Functions | |
| File (std::string fullpath, void *userdata) | |
| File (std::string fullpath, sg_host_t host, void *userdata) | |
| ~File () | |
| const char * | getPath () |
| Retrieves the path to the file. More... | |
| sg_size_t | read (sg_size_t size) |
| Simulates a local read action. More... | |
| sg_size_t | write (sg_size_t size) |
| Simulates a write action. More... | |
| void | setUserdata (void *data) |
| Allows to store user data on that host. More... | |
| void * | getUserdata () |
| Retrieves the previously stored data. More... | |
| sg_size_t | size () |
| Retrieve the datasize. More... | |
| void | seek (sg_offset_t pos) |
| Sets the file head to the given position. More... | |
| void | seek (sg_offset_t pos, int origin) |
| sg_size_t | tell () |
| Retrieves the current file position. More... | |
| void | move (std::string fullpath) |
| Rename a file. More... | |
| int | unlink () |
| Remove a file from disk. More... | |
Public Attributes | |
| std::string | storage_type |
| std::string | storageId |
| std::string | mount_point |
| int | desc_id = 0 |
| simgrid::s4u::File::File | ( | std::string | fullpath, |
| void * | userdata | ||
| ) |
| simgrid::s4u::File::File | ( | std::string | fullpath, |
| sg_host_t | host, | ||
| void * | userdata | ||
| ) |
| simgrid::s4u::File::~File | ( | ) |
|
inline |
Retrieves the path to the file.
Simulates a local read action.
Returns the size of data actually read
Simulates a write action.
Returns the size of data actually written.
|
inline |
Retrieves the previously stored data.
| sg_size_t simgrid::s4u::File::size | ( | ) |
Retrieve the datasize.
| void simgrid::s4u::File::seek | ( | sg_offset_t | pos | ) |
Sets the file head to the given position.
| void simgrid::s4u::File::seek | ( | sg_offset_t | pos, |
| int | origin | ||
| ) |
| sg_size_t simgrid::s4u::File::tell | ( | ) |
Retrieves the current file position.
| void simgrid::s4u::File::move | ( | std::string | fullpath | ) |
Rename a file.
WARNING: It is forbidden to move the file to another mount point
| int simgrid::s4u::File::unlink | ( | ) |
Remove a file from disk.
| std::string simgrid::s4u::File::storage_type |
| std::string simgrid::s4u::File::storageId |
| std::string simgrid::s4u::File::mount_point |
| int simgrid::s4u::File::desc_id = 0 |