Raspberry Cloud
Public Member Functions | List of all members
CloudFileSystem Class Reference

#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)
 
DistributorgetDistributor ()
 
CloudAccessLayergetCloudAccessLayer ()
 
HomeNetworkCommunicationsgetHomeNetworkCommunications ()
 
CachegetCache ()
 
list< FileDescriptor * > * getFileTree ()
 
CloudFileListgetCloudFileList ()
 
bool addToFileTreeByID (FileDescriptor *fileDescriptor)
 
bool delFromFileTreeByID (FileDescriptor *fileDescriptor)
 
FileDescriptorfindByID (FileDescriptor *fileDescriptor)
 
void lock (FileDescriptor fileDescriptor)
 
void unlock (FileDescriptor fileDescriptor)
 
bool isLocked (FileDescriptor fileDescriptor)
 

Detailed Description

CloudFileSystem class Maintaines the files that are held in the cloud One can add, download, delete files, It handles mutexes, cache usage and directories.

Constructor & Destructor Documentation

CloudFileSystem::CloudFileSystem ( Application application)

CloudFileSystem constuctor

Parameters
applicationreference to the Application object
CloudFileSystem::~CloudFileSystem ( )

CloudFileSystem destructor Needed to free memory objects

Member Function Documentation

bool CloudFileSystem::addFile ( string  localFileID,
string  destinationFileID 
)

Adds given file to the cloud Uses the set HomeNetworkBehaviour

Parameters
localFileIDfull path of the local file to upload
destinationFileIDfull 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

Parameters
directoryIDpath of the directory to be created
bool CloudFileSystem::deleteFile ( FileDescriptor  fileDescriptor)

Deletes a file from the cloud It is completed through the CloudAccessLayer

Parameters
fileDescriptordescriptor 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

Returns
value of setComputePi
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

Parameters
fileDescriptordescriptor 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

Parameters
fileDescriptordescriptor of the file to be determined
Returns
true if any of the fragments are locked, false otherwise
void CloudFileSystem::lock ( FileDescriptor  fileDescriptor)

Creates a lock on a given file.

Parameters
fileDescriptordescriptor of thefile to be locked
void CloudFileSystem::setComputeOnPi ( bool  setComputeOnPi)

Setter to the setComputePi variable Sets the right HomeNetworkBehaviour

Parameters
setComputeOnPivalue to be set
void CloudFileSystem::setHomeNetworkBehaviour ( HomeNetworkBehaviour homeNetworkBehaviour)

Setter to homeNetworkBehaviour

Parameters
homeNetworkBehaviourpointer of homeNetworkBehaviour to be set
void CloudFileSystem::unlock ( FileDescriptor  fileDescriptor)

Unlocks a given file

Parameters
fileDescriptordescriptor of the fiel to be unlocked

The documentation for this class was generated from the following files: