2010-05-20 18:58:17 +02:00
/* -------------------------------------------------------------------------- */
2020-04-30 15:00:02 +02:00
/* Copyright 2002-2020, OpenNebula Project, OpenNebula Systems */
2010-05-20 18:58:17 +02:00
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
# ifndef IMAGE_TEMPLATE_H_
# define IMAGE_TEMPLATE_H_
2010-08-03 16:22:48 +02:00
# include "Template.h"
2010-05-20 18:58:17 +02:00
using namespace std ;
/**
2011-10-11 00:20:50 +02:00
* Image Template class , it represents the attributes of an Image
2010-05-20 18:58:17 +02:00
*/
2010-08-03 16:22:48 +02:00
class ImageTemplate : public Template
2010-05-20 18:58:17 +02:00
{
public :
2010-08-03 16:22:48 +02:00
ImageTemplate ( ) : Template ( true , ' = ' , " TEMPLATE " ) { } ;
2010-05-20 18:58:17 +02:00
2012-06-12 18:59:23 +02:00
ImageTemplate ( const ImageTemplate & tmpl ) : Template ( tmpl ) { } ;
2012-05-25 12:56:51 +02:00
2010-05-20 18:58:17 +02:00
~ ImageTemplate ( ) { } ;
2012-01-20 17:45:14 +01:00
2015-06-10 19:56:35 +02:00
bool is_saving ( )
2013-03-01 19:04:56 +01:00
{
2015-06-09 23:25:10 +02:00
bool save_as_hot ;
2012-03-05 23:49:18 +01:00
2015-06-09 23:25:10 +02:00
get ( " SAVE_AS_HOT " , save_as_hot ) ;
2012-03-05 23:49:18 +01:00
2015-06-09 23:25:10 +02:00
return save_as_hot ;
2012-03-05 23:49:18 +01:00
}
2015-06-10 19:56:35 +02:00
void set_saving ( )
2013-03-01 19:04:56 +01:00
{
2015-06-09 23:25:10 +02:00
replace ( " SAVE_AS_HOT " , " YES " ) ;
2012-03-05 23:49:18 +01:00
}
2017-09-04 01:14:47 +02:00
// -------------------------------------------------------------------------
// Restricted attributes interface implementation
// -------------------------------------------------------------------------
virtual bool check_restricted ( string & rs_attr , const Template * base )
{
return Template : : check_restricted ( rs_attr , base , restricted ) ;
}
2012-01-23 08:18:12 -08:00
2017-09-04 01:14:47 +02:00
virtual bool check_restricted ( string & rs_attr )
{
return Template : : check_restricted ( rs_attr , restricted ) ;
}
2012-01-23 08:18:12 -08:00
2017-09-04 01:14:47 +02:00
static void parse_restricted ( vector < const SingleAttribute * > & ra )
2014-10-06 16:57:40 +02:00
{
2017-09-04 01:14:47 +02:00
Template : : parse_restricted ( ra , restricted ) ;
}
2014-10-06 16:57:40 +02:00
2017-09-04 01:14:47 +02:00
private :
2012-01-24 03:00:57 -08:00
/**
2017-09-04 01:14:47 +02:00
* Restricted attribute list for ImageTemplates
2012-01-24 03:00:57 -08:00
*/
2017-09-04 01:14:47 +02:00
static std : : map < std : : string , std : : set < std : : string > > restricted ;
2010-05-20 18:58:17 +02:00
} ;
2013-03-07 22:44:18 +01:00
2010-05-20 18:58:17 +02:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif /*IMAGE_TEMPLATE_H_*/