Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem app epson mbed msp430 pl tests
book.cpp
- Committer:
- group-FlexBook
- Date:
- 2017-12-04
- Revision:
- 0:fa7450a43b99
File content as of revision 0:fa7450a43b99:
//
// Filename: book.h
//
// Container for Flexbook pages.
//
#include "book.h"
#include "log.h"
#include "pagefactory.h"
#include "page.h"
#include <iostream>
namespace Flexbook {
Book::Book(PageFactory &thefactory)
: factory(thefactory),
pagetype(PageType_PageNull),
page(nullptr)
{
Log("Creating Book");
}
Book::~Book()
{
Log("Deleting Book");
}
void Book::PageChange(PageType type)
{
Log("Page change");
// Delete the old page.
page.reset();
pagetype = PageType_PageNull;
// Create the new page and any of it's dependencies.
page = factory.CreatePages(type);
pagetype = type;
}
PageType Book::GetPageType() const
{
return pagetype;
}
void Book::HandleActions()
{
if(page.get())
page->HandlePageActions();
}
} // End Flexbook namespace.