libschauer  0.0.1
Qt based library to access the Docker HTTP API.
Properties | Public Member Functions | Signals | Protected Member Functions | List of all members
Schauer::AbstractContainerModel Class Reference

Base class for models providing a list or table of available containers. More...

#include <abstractcontainermodel.h>

Inheritance diagram for Schauer::AbstractContainerModel:
Inheritance graph
[legend]

Properties

bool showAll
 Set this to true to show all containers. More...
 
bool showSize
 Set this to true to return size of the container. More...
 
- Properties inherited from Schauer::AbstractBaseModel
Schauer::AbstractConfiguration configuration
 Pointer to an object providing configuration data. More...
 
int error
 Error code. More...
 
QString errorString
 Human-readable error message. More...
 
bool isLoading
 Indicates loading state. More...
 

Public Member Functions

 AbstractContainerModel (QObject *parent=nullptr)
 Constructs a new AbstractContainerModel object with the given parent. More...
 
 ~AbstractContainerModel () override
 Destroys the AbstractContainerModel object. More...
 
bool contains (const QString &idOrName) const
 Returns true if the model contains a container identified by idOrName. More...
 
bool contains (QLatin1String idOrName) const
 
bool containsImage (const QString &image) const
 Returns true if the model contains a container that is based on image. More...
 
bool containsImage (QLatin1String &image) const
 
bool containsImageId (const QString &imageId) const
 Returns true if the model contains a container that is based on imageId. More...
 
bool containsImageId (QLatin1String &imageId) const
 
void setShowAll (bool showAll)
 Setter function for the showAll property. More...
 
void setShowSize (bool showSize)
 Setter function for the showSize property. More...
 
bool showAll () const
 Getter function for the showAll property. More...
 
bool showSize () const
 Getter function for the showSize property. More...
 
- Public Member Functions inherited from Schauer::AbstractBaseModel
 AbstractBaseModel (QObject *parent=nullptr)
 Constructs a new AbstractBaseModel class with the given parent. More...
 
 ~AbstractBaseModel () override
 Destroys the AbstractBaseModel object. More...
 
AbstractConfigurationconfiguration () const
 Getter function for the configuraion property. More...
 
int error () const
 Returns the error code, if there has been an error. More...
 
QString errorString () const
 Returns the human-readable error message. More...
 
bool isLoading () const
 Returns true while the model is loading, otherwise returns false. More...
 
void setConfiguration (AbstractConfiguration *configuration)
 Setter function for the configuraion property. More...
 

Signals

void showAllChanged (bool showAll)
 Notifier signal for the showAll property. More...
 
void showSizeChanged (bool showSize)
 Notifier signal for the showSize property. More...
 
- Signals inherited from Schauer::AbstractBaseModel
void configurationChanged (Schauer::AbstractConfiguration *configuration)
 Notifier signal for the configuration property. More...
 
void errorChanged (int error)
 Notifier signal for the error property. More...
 
void isLoadingChanged (bool isLoading)
 Notifier signal for the isLoading property. More...
 
void loaded ()
 Emitted to indicate model data loading has been finished. More...
 

Protected Member Functions

void clear () override
 Clears the model data. More...
 

Additional Inherited Members

- Public Types inherited from Schauer::AbstractBaseModel
enum  LoadMode : int { LoadAsync, LoadSync }
 Load mode for model. More...
 
- Public Slots inherited from Schauer::AbstractBaseModel
bool load (Schauer::AbstractBaseModel::LoadMode mode=LoadAsync)
 Loads the model data. More...
 

Detailed Description

Base class for models providing a list or table of available containers.

This uses ListContainersJob to get a list of containers from the Docker daemon.

See ContainerListModel for a full implementation.

Todo:
Add data storage for container Ports, HostConfig, NetworkSettings and Mounts.

Property Documentation

◆ showAll

bool AbstractContainerModel::showAll
readwrite

Set this to true to show all containers.

By default this is false and only running containers are shown.

Access functions
Notifier signal

◆ showSize

bool AbstractContainerModel::showSize
readwrite

Set this to true to return size of the container.

The size will be shown in the fields SizeRw and SizeRootFs. By default this is set to false.

Access function
Notifier signal

Constructor & Destructor Documentation

◆ AbstractContainerModel()

AbstractContainerModel::AbstractContainerModel ( QObject parent = nullptr)
explicit

Constructs a new AbstractContainerModel object with the given parent.

◆ ~AbstractContainerModel()

AbstractContainerModel::~AbstractContainerModel ( )
overridedefault

Destroys the AbstractContainerModel object.

Member Function Documentation

◆ clear()

void AbstractContainerModel::clear ( )
overrideprotectedvirtual

Clears the model data.

The default implementation dos nothing.

Reimplemented from Schauer::AbstractBaseModel.

◆ contains() [1/2]

bool AbstractContainerModel::contains ( const QString idOrName) const

Returns true if the model contains a container identified by idOrName.

idOrName can be either a container ID or a container name.

◆ contains() [2/2]

bool AbstractContainerModel::contains ( QLatin1String  idOrName) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ containsImage() [1/2]

bool AbstractContainerModel::containsImage ( const QString image) const

Returns true if the model contains a container that is based on image.

◆ containsImage() [2/2]

bool AbstractContainerModel::containsImage ( QLatin1String image) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ containsImageId() [1/2]

bool AbstractContainerModel::containsImageId ( const QString imageId) const

Returns true if the model contains a container that is based on imageId.

◆ containsImageId() [2/2]

bool AbstractContainerModel::containsImageId ( QLatin1String imageId) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ setShowAll()

void AbstractContainerModel::setShowAll ( bool  showAll)

Setter function for the showAll property.

See also
showAll(), showAllChanged()

◆ setShowSize()

void AbstractContainerModel::setShowSize ( bool  showSize)

Setter function for the showSize property.

See also
showSize(), showSizeChanged()

◆ showAll()

bool Schauer::AbstractContainerModel::showAll ( ) const

Getter function for the showAll property.

See also
setShowAll(), showAllChanged()

◆ showAllChanged

void Schauer::AbstractContainerModel::showAllChanged ( bool  showAll)
signal

Notifier signal for the showAll property.

See also
showAll(), setShowAll

◆ showSize()

bool Schauer::AbstractContainerModel::showSize ( ) const

Getter function for the showSize property.

See also
setShowSize(), showSizeChanged()

◆ showSizeChanged

void Schauer::AbstractContainerModel::showSizeChanged ( bool  showSize)
signal

Notifier signal for the showSize property.

See also
showSize(), setShowSize()

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