Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
stop loading private headers from now public NetZoneImpl.hpp
[simgrid.git] / src / plugins / file_system / FileSystem.hpp
index 205c879..d2e742d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -24,12 +24,11 @@ namespace s4u {
  * mountpoints.
  * For now, you cannot change the mountpoints programatically, and must declare them from your platform file.
  */
-XBT_PUBLIC_CLASS File
-{
+class XBT_PUBLIC File {
 public:
   File(std::string fullpath, void* userdata);
   File(std::string fullpath, sg_host_t host, void* userdata);
-  ~File() = default;
+  ~File();
 
   /** Retrieves the path to the file */
   const char* getPath() { return fullpath_.c_str(); }
@@ -52,6 +51,8 @@ public:
 
   /** Rename a file. WARNING: It is forbidden to move the file to another mount point */
   void move(std::string fullpath);
+  int remoteCopy(sg_host_t host, const char* fullpath);
+  int remoteMove(sg_host_t host, const char* fullpath);
 
   int unlink(); /** Remove a file from the contents of a disk */
   void dump();
@@ -68,10 +69,10 @@ private:
   void* userdata_             = nullptr;
 };
 
-class FileSystemStorageExt {
+class XBT_PUBLIC FileSystemStorageExt {
 public:
-  static simgrid::xbt::Extension<simgrid::s4u::Storage, FileSystemStorageExt> EXTENSION_ID;
-  explicit FileSystemStorageExt(simgrid::s4u::Storage* ptr);
+  static simgrid::xbt::Extension<Storage, FileSystemStorageExt> EXTENSION_ID;
+  explicit FileSystemStorageExt(Storage* ptr);
   ~FileSystemStorageExt();
   std::map<std::string, sg_size_t>* parseContent(std::string filename);
   std::map<std::string, sg_size_t>* getContent() { return content_; }
@@ -84,6 +85,14 @@ private:
   sg_size_t usedSize_ = 0;
   sg_size_t size_     = 0;
 };
+
+class XBT_PUBLIC FileDescriptorHostExt {
+public:
+  static simgrid::xbt::Extension<Host, FileDescriptorHostExt> EXTENSION_ID;
+  FileDescriptorHostExt() = default;
+  ~FileDescriptorHostExt() { delete file_descriptor_table; }
+  std::vector<int>* file_descriptor_table = nullptr; // Created lazily on need
+};
 }
 } // namespace simgrid::s4u