Raspberry Cloud
|
#include <CloudFileSystem.h>
Public Member Functions | |
void | setComputeOnPi (bool setComputeOnPi) |
bool | getComputeOnPi () |
CloudFileSystem (Application &application) | |
~CloudFileSystem () | |
bool | addFile (string localFileID, string destinationFileID) |
string | getFile (FileDescriptor fileDescriptor) |
bool | createDirectory (string directoryID) |
bool | deleteFile (FileDescriptor fileDescriptor) |
void | setHomeNetworkBehaviour (HomeNetworkBehaviour *homeNetworkBehaviour) |
Distributor * | getDistributor () |
CloudAccessLayer * | getCloudAccessLayer () |
HomeNetworkCommunications * | getHomeNetworkCommunications () |
Cache * | getCache () |
list< FileDescriptor * > * | getFileTree () |
CloudFileList * | getCloudFileList () |
bool | addToFileTreeByID (FileDescriptor *fileDescriptor) |
bool | delFromFileTreeByID (FileDescriptor *fileDescriptor) |
FileDescriptor * | findByID (FileDescriptor *fileDescriptor) |
void | lock (FileDescriptor fileDescriptor) |
void | unlock (FileDescriptor fileDescriptor) |
bool | isLocked (FileDescriptor fileDescriptor) |
CloudFileSystem class Maintaines the files that are held in the cloud One can add, download, delete files, It handles mutexes, cache usage and directories.
CloudFileSystem::CloudFileSystem | ( | Application & | application | ) |
CloudFileSystem constuctor
application | reference to the Application object |
CloudFileSystem::~CloudFileSystem | ( | ) |
CloudFileSystem destructor Needed to free memory objects
bool CloudFileSystem::addFile | ( | string | localFileID, |
string | destinationFileID | ||
) |
Adds given file to the cloud Uses the set HomeNetworkBehaviour
localFileID | full path of the local file to upload |
destinationFileID | full path of the file on the cloud |
bool CloudFileSystem::addToFileTreeByID | ( | FileDescriptor * | fileDescriptor | ) |
Adds a new fileDescriptor to the fileTree
bool CloudFileSystem::createDirectory | ( | string | directoryID | ) |
Creates a directory on the cloud not sure how its gonna work
directoryID | path of the directory to be created |
bool CloudFileSystem::deleteFile | ( | FileDescriptor | fileDescriptor | ) |
Deletes a file from the cloud It is completed through the CloudAccessLayer
fileDescriptor | descriptor of the file to be downloaded |
bool CloudFileSystem::delFromFileTreeByID | ( | FileDescriptor * | fileDescriptor | ) |
Deletes a fileDescriptor from the fileTree
FileDescriptor * CloudFileSystem::findByID | ( | FileDescriptor * | fileDescriptor | ) |
Retrieves fileDescriptor from the fileTree
Cache * CloudFileSystem::getCache | ( | ) |
Getter to the cache pointer
CloudAccessLayer * CloudFileSystem::getCloudAccessLayer | ( | ) |
Gets CloudAccessLayer from application
CloudFileList * CloudFileSystem::getCloudFileList | ( | ) |
Getter to the fileTree attribute
bool CloudFileSystem::getComputeOnPi | ( | ) |
Getter to the setComputePi variable
Distributor * CloudFileSystem::getDistributor | ( | ) |
Getter to distributor variable
string CloudFileSystem::getFile | ( | FileDescriptor | fileDescriptor | ) |
Downloads a file from the cloud Uses the set HomeNetworkBehaviour Returns with "" if none is set
fileDescriptor | descriptor of the file to be retrieved |
list< FileDescriptor * > * CloudFileSystem::getFileTree | ( | ) |
Getter to the fileTree attribute
HomeNetworkCommunications * CloudFileSystem::getHomeNetworkCommunications | ( | ) |
Gets HomeNetworkCommunications from application
bool CloudFileSystem::isLocked | ( | FileDescriptor | fileDescriptor | ) |
Determines weather a file is locked
fileDescriptor | descriptor of the file to be determined |
void CloudFileSystem::lock | ( | FileDescriptor | fileDescriptor | ) |
Creates a lock on a given file.
fileDescriptor | descriptor of thefile to be locked |
void CloudFileSystem::setComputeOnPi | ( | bool | setComputeOnPi | ) |
Setter to the setComputePi variable Sets the right HomeNetworkBehaviour
setComputeOnPi | value to be set |
void CloudFileSystem::setHomeNetworkBehaviour | ( | HomeNetworkBehaviour * | homeNetworkBehaviour | ) |
Setter to homeNetworkBehaviour
homeNetworkBehaviour | pointer of homeNetworkBehaviour to be set |
void CloudFileSystem::unlock | ( | FileDescriptor | fileDescriptor | ) |
Unlocks a given file
fileDescriptor | descriptor of the fiel to be unlocked |