Mehr Anwendungsstrukturfoo:

Sicobject: Repräsentation der Hochgeladenen Files
Sicmaster:global Interconnect und Laufzeitdatenverwaltung
master
john stone 9 years ago
parent 6557a866ef
commit aa6c74c15e

@ -0,0 +1,34 @@
#pragma once
/// Laufzeitrelevante Anwendungsdatensammlung und Signaling
#include <string>
class Sicmaster
{
public:
//Sicmaster(StaticFileHandler &sfh);
~Sicmaster();
// const ???
static Sicmaster * get_instance()
{
static Sicmaster * me = nullptr;
if (!me)
return me = new Sicmaster();
return me;
}
std::string & get_baseurl(){
return _baseurl;
}
private:
explicit Sicmaster();
unsigned int _portnum;
unsigned int _filedir;
std::string _baseurl;
};

@ -0,0 +1,40 @@
#pragma once
#include "Sicmaster.H"
class Sicobject
{
public:
Sicobject() = delete; //was war noch mal ein explicit constructor?
Sicobject(Sicmaster & master) :
_sicmaster(master),
_isvalid(false)
{
};
Sicobject(Sicmaster &master, unsigned int idnum, std::string fname,size_t objsize) :
_size(objsize),
_idnum(idnum),
_sicmaster(master),
_isvalid(true),
_fname(fname)
{
}
~Sicobject();
std::string get_loadurl(){
std::string retval = "files/"; //TODO add master.get_baseurl()
//TODO: add idnum
return retval;
}
size_t get_size() { return _size;}
private:
size_t _size;
unsigned int _idnum;
Sicmaster & _sicmaster;
bool _isvalid;
std::string _fname;
};
Loading…
Cancel
Save