libstorage-ng
Toggle main menu visibility
Loading...
Searching...
No Matches
Swap.h
1
/*
2
* Copyright (c) [2014-2015] Novell, Inc.
3
* Copyright (c) 2020 SUSE LLC
4
*
5
* All Rights Reserved.
6
*
7
* This program is free software; you can redistribute it and/or modify it
8
* under the terms of version 2 of the GNU General Public License as published
9
* by the Free Software Foundation.
10
*
11
* This program is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
* more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, contact Novell, Inc.
18
*
19
* To contact Novell about this file by physical or electronic mail, you may
20
* find current contact information at www.novell.com.
21
*/
22
23
24
#ifndef STORAGE_SWAP_H
25
#define STORAGE_SWAP_H
26
27
28
#include "storage/Filesystems/BlkFilesystem.h"
29
30
31
namespace
storage
32
{
33
39
class
Swap :
public
BlkFilesystem
40
{
41
public
:
42
49
static
Swap*
create
(
Devicegraph
* devicegraph);
50
51
static
Swap* load(
Devicegraph
* devicegraph,
const
xmlNode* node);
52
56
static
std::vector<Swap*>
get_all
(
Devicegraph
* devicegraph);
57
61
static
std::vector<const Swap*>
get_all
(
const
Devicegraph
* devicegraph);
62
63
public
:
64
65
class
Impl;
66
67
Impl& get_impl();
68
const
Impl& get_impl()
const
;
69
70
virtual
Swap* clone()
const override
;
71
virtual
std::unique_ptr<Device> clone_v2()
const override
;
72
73
Swap(Impl* impl);
74
ST_NO_SWIG Swap(std::unique_ptr<Device::Impl>&& impl);
75
76
};
77
78
84
bool
is_swap
(
const
Device
* device);
85
92
Swap
*
to_swap
(
Device
* device);
93
97
const
Swap
*
to_swap
(
const
Device
* device);
98
99
}
100
101
#endif
storage::Device
An abstract base class for storage devices.
Definition
Device.h:82
storage::Devicegraph
The main container of the libstorage-ng.
Definition
Devicegraph.h:170
storage::Swap
Class to represent a swap filesystem in the devicegraph.
Definition
Swap.h:40
storage::Swap::get_all
static std::vector< Swap * > get_all(Devicegraph *devicegraph)
Get all Swaps.
storage::Swap::create
static Swap * create(Devicegraph *devicegraph)
Create a device of type Swap.
storage::Swap::get_all
static std::vector< const Swap * > get_all(const Devicegraph *devicegraph)
Get all Swaps.
storage
The storage namespace.
Definition
Actiongraph.h:40
storage::is_swap
bool is_swap(const Device *device)
Checks whether device points to an Swap.
storage::to_swap
Swap * to_swap(Device *device)
Converts pointer to Device to pointer to Swap.
storage
Filesystems
Swap.h
Generated by
1.17.0