Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
storage_table.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27/**
28 * @brief Defines StorageTable interface
29 *
30 * @file storage_table.h
31 */
32
33#ifndef API_MIP_STORAGE_TABLE_H_
34#define API_MIP_STORAGE_TABLE_H_
35
36#include <string>
37#include <vector>
38
39#include "mip/mip_namespace.h"
40
41MIP_NAMESPACE_BEGIN
42
43/**
44 * @brief A class that defines the interface to the MIP SDK storage table used for caching
45 */
47public:
48 /**
49 * @brief Adds a row to the table
50 *
51 * @param allColumnValues All column values in sequence as represented in storage table.
52 *
53 * @deprecated This method will soon be deprecated in favor of InsertOrReplace. If the new version
54 * has been implemented, there is no need to implement this version.
55 */
56#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
57 [[deprecated("Insert method is deprecated, instead use InsertOrReplace method")]]
58#endif
59 virtual void Insert(const std::vector<std::string>& allColumnValues)
60 {
61 InsertOrReplace(allColumnValues);
62 }
63
64 /**
65 * @brief Adds a row to the table
66 *
67 * @param allColumnValues All column values in sequence as represented in storage table.
68 */
69 virtual void InsertOrReplace(const std::vector<std::string>& allColumnValues) = 0;
70
71 /**
72 * @brief List all the rows in the table
73 *
74 * @return List of all rows where each row is a vector of column values
75 */
76 virtual std::vector<std::vector<std::string>> List() = 0;
77
78 /**
79 * @brief Update a set of rows within the table.
80 *
81 * @param updateColumns List of column names that define the new row data.
82 * @param updateValues List of column values corresponding to @p updateColumns.
83 * @param queryColumns List of column names that identify the table rows to update.
84 * @param queryValues List of column values corresponding to @p queryColumns.
85 *
86 */
87 virtual void Update(
88 const std::vector<std::string>& updateColumns,
89 const std::vector<std::string>& updateValues,
90 const std::vector<std::string>& queryColumns,
91 const std::vector<std::string>& queryValues) = 0;
92
93 /**
94 * @brief Delete a set of rows specified by queryColumns and queryValues
95 *
96 * @param queryColumns List of column names that identify the table rows to delete.
97 * @param queryValues List of column values corresponding to @p queryColumns.
98 *
99 */
100 virtual void Delete(
101 const std::vector<std::string>& queryColumns,
102 const std::vector<std::string>& queryValues) = 0;
103
104 /**
105 * @brief Find a set of rows specified by @p queryColumns and @p queryValues. This method can return multiple rows based on the filter.
106 *
107 * @param queryColumns List of column names that identify the table rows to find.
108 * @param queryValues List of column values corresponding to @p queryColumns.
109 *
110 * @return List of all rows where each row is a list containing column values
111 */
112 virtual std::vector<std::vector<std::string>> Find(
113 const std::vector<std::string>& queryColumns,
114 const std::vector<std::string>& queryValues) = 0;
115
116 /** @cond DOXYGEN_HIDE */
117 virtual ~StorageTable() {}
118protected:
119 StorageTable() {}
120 /** @endcond */
121};
122
123MIP_NAMESPACE_END
124#endif // API_MIP_STORAGE_TABLE_H_
A class that defines the interface to the MIP SDK storage table used for caching.
virtual void Delete(const std::vector< std::string > &queryColumns, const std::vector< std::string > &queryValues)=0
Delete a set of rows specified by queryColumns and queryValues.
virtual void Insert(const std::vector< std::string > &allColumnValues)
Adds a row to the table.
virtual void InsertOrReplace(const std::vector< std::string > &allColumnValues)=0
Adds a row to the table.
virtual void Update(const std::vector< std::string > &updateColumns, const std::vector< std::string > &updateValues, const std::vector< std::string > &queryColumns, const std::vector< std::string > &queryValues)=0
Update a set of rows within the table.
virtual std::vector< std::vector< std::string > > List()=0
List all the rows in the table.
virtual std::vector< std::vector< std::string > > Find(const std::vector< std::string > &queryColumns, const std::vector< std::string > &queryValues)=0
Find a set of rows specified by queryColumns and queryValues.
MIP namespace macros.