diff options
Diffstat (limited to 'libresourceqt/src/resource.cpp')
-rw-r--r-- | libresourceqt/src/resource.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/libresourceqt/src/resource.cpp b/libresourceqt/src/resource.cpp new file mode 100644 index 0000000..8207b66 --- /dev/null +++ b/libresourceqt/src/resource.cpp @@ -0,0 +1,57 @@ +#include "resource.h" + +using namespace ResourcePolicy; + +Resource::Resource() + : optional(false), shared(false), + identifier(0), granted(false) +{ + identifier = (quint32)this; +} + +Resource::Resource(const Resource &other) + : optional(other.optional), shared(other.shared), + identifier(other.identifier), granted(other.granted) +{ +} + +Resource::~Resource() +{ +} + +bool Resource::isOptional() const +{ + return optional; +} + +void Resource::setOptional(bool resourceIsOptional) +{ + optional = resourceIsOptional; +} + +bool Resource::isShared() const +{ + return shared; +} + +void Resource::setShared(bool shared) +{ + this->shared = shared; +} + +bool Resource::isGranted() const +{ + return granted; +} + +void Resource::setGranted() +{ + granted = true; +} + +void Resource::unsetGranted() +{ + granted = false; +} + + |