88 File(
const std::string& name,
const bool create_new);
97 static void remove(
const std::string&
filename);
112 static bool exists(
const std::string& filename);
213 typedef std::map<std::string, std::shared_ptr<std::fstream> > StreamMap;
214 typedef std::map<std::string, int> CountMap;
272 PageFile(
const std::string& name,
const bool create_new);
371 const Page& new_page);
420 BlobFile(
const std::string& name,
const bool create_new);
static std::streampos pagePosition(const PageId page_number)
static bool isOpen(const std::string &filename)
static CountMap open_counts_
void deletePage(const PageId page_number)
std::shared_ptr< std::fstream > stream_
virtual void writePage(const PageId page_number, const Page &new_page)=0
const std::string & filename() const
File(const std::string &name, const bool create_new)
Page allocatePage(PageId &new_page_number)
void writePage(const PageId page_number, const Page &new_page)
void deletePage(const PageId page_number)
static PageFile open(const std::string &filename)
BlobFile(const std::string &name, const bool create_new)
Class which represents a file in the filesystem containing database pages.
virtual void deletePage(const PageId page_number)=0
void writeHeader(const FileHeader &header)
Page readPage(const PageId page_number) const
std::uint32_t PageId
Identifier for a page in a file.
static const std::size_t SIZE
Class which represents a fixed-size database page containing records.
void writePage(const PageId page_number, const Page &new_page)
void openIfNeeded(const bool create_new)
Page readPage(const PageId page_number) const
BlobFile & operator=(const BlobFile &rhs)
Iterator for iterating over the pages in a file.
PageFile(const std::string &name, const bool create_new)
static PageFile create(const std::string &filename)
virtual Page readPage(const PageId page_number) const =0
static BlobFile open(const std::string &filename)
virtual Page allocatePage(PageId &new_page_number)=0
Page allocatePage(PageId &new_page_number)
static BlobFile create(const std::string &filename)
PageFile & operator=(const PageFile &rhs)
static StreamMap open_streams_
FileHeader readHeader() const
static bool exists(const std::string &filename)