1 /* 2 * Copyright 2001-2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef USERLAND_FS_FILE_SYSTEM_INITIALIZER_H 6 #define USERLAND_FS_FILE_SYSTEM_INITIALIZER_H 7 8 #include <Referenceable.h> 9 10 #include "LazyInitializable.h" 11 12 13 namespace UserlandFSUtil { 14 15 class RequestPort; 16 17 } 18 19 using UserlandFSUtil::RequestPort; 20 21 class FileSystem; 22 23 class FileSystemInitializer : public LazyInitializable, public Referenceable { 24 public: 25 FileSystemInitializer(const char* name); 26 ~FileSystemInitializer(); 27 28 inline FileSystem* GetFileSystem() { return fFileSystem; } 29 30 protected: 31 virtual status_t FirstTimeInit(); 32 33 private: 34 status_t _Init(port_id port); 35 36 private: 37 const char* fName; // valid only until FirstTimeInit() 38 FileSystem* fFileSystem; 39 }; 40 41 #endif // USERLAND_FS_FILE_SYSTEM_INITIALIZER_H 42