summaryrefslogtreecommitdiff
path: root/src/idbobject.h
blob: 8b04551a14435a4bb90051205914d2b54b193354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

class IDbObject
{
public:
    /*!
     * \brief getDbId - check if object exists in db and return its id if any
     * \return id on success, 0 otherwise
     */
    virtual int getDbId() = 0;

    /*!
     * \brief createInDb - create object in db
     * \return new object id on success, 0 otherwise
     */
    virtual int createInDb() = 0;

    /*!
     * \brief getOrInsertDbId - get existing object id or try to create a new
     * object and get its id
     * \return existing or new object id on success, 0 otherwise
     */
    virtual int getOrInsertDbId() = 0;
};