1 // FileSystemInitializer.h 2 3 #ifndef USERLAND_FS_FILE_SYSTEM_INITIALIZER_H 4 #define USERLAND_FS_FILE_SYSTEM_INITIALIZER_H 5 6 #include "LazyInitializable.h" 7 #include "Referencable.h" 8 9 10 namespace UserlandFSUtil { 11 12 class RequestPort; 13 14 } 15 16 using UserlandFSUtil::RequestPort; 17 18 class FileSystem; 19 20 class FileSystemInitializer : public LazyInitializable, public Referencable { 21 public: 22 FileSystemInitializer(const char* name, 23 RequestPort* initPort); 24 ~FileSystemInitializer(); 25 26 inline FileSystem* GetFileSystem() { return fFileSystem; } 27 28 protected: 29 virtual status_t FirstTimeInit(); 30 31 private: 32 const char* fName; // valid only until FirstTimeInit() 33 RequestPort* fInitPort; 34 FileSystem* fFileSystem; 35 }; 36 37 #endif // USERLAND_FS_FILE_SYSTEM_INITIALIZER_H 38