1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-19 10:03:36 +03:00
one/include/ObjectSQL.h
Ruben S. Montero 88341b948b Fix compilation warnings with gcc 4.1.2 (CentOS 5.4). Patch by Charles Loomis & Ruben S. Montero
(cherry picked from commit f12a1b6e1cbe2ef07c33dbfe9da7876182a750a2)

Conflicts:

	include/RequestManager.h
	src/host/Host.cc
	src/rm/RequestManagerPoolInfo.cc
2010-09-02 20:44:14 +02:00

74 lines
2.3 KiB
C++

/* -------------------------------------------------------------------------- */
/* Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* 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 OBJECT_SQL_H_
#define OBJECT_SQL_H_
#include "Callbackable.h"
#include "SqlDB.h"
using namespace std;
/**
* ObjectSQL class. Provides a SQL backend interface, it should be implemented
* by persistent objects.
*/
class ObjectSQL : public Callbackable
{
public:
ObjectSQL(){};
virtual ~ObjectSQL(){};
protected:
/**
* Reads the ObjectSQL (identified with its OID) from the database.
* @param db pointer to the db
* @return 0 on success
*/
virtual int select(
SqlDB * db) = 0;
/**
* Writes the ObjectSQL in the database.
* @param db pointer to the db
* @return 0 on success
*/
virtual int insert(
SqlDB * db,
string& error_str) = 0;
/**
* Updates the ObjectSQL in the database.
* @param db pointer to the db
* @return 0 on success
*/
virtual int update(
SqlDB * db) = 0;
/**
* Removes the ObjectSQL from the database.
* @param db pointer to the db
* @return 0 on success
*/
virtual int drop(
SqlDB * db) = 0;
};
#endif /*OBJECT_SQL_H_*/