Blender  V2.93
spreadsheet_column.hh
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
19 #include "DNA_space_types.h"
20 
21 #include "BLI_hash.hh"
22 
23 namespace blender {
24 template<> struct DefaultHash<SpreadsheetColumnID> {
25  uint64_t operator()(const SpreadsheetColumnID &column_id) const
26  {
27  return get_default_hash(StringRef(column_id.name));
28  }
29 };
30 } // namespace blender
31 
32 inline bool operator==(const SpreadsheetColumnID &a, const SpreadsheetColumnID &b)
33 {
34  using blender::StringRef;
35  return StringRef(a.name) == StringRef(b.name);
36 }
37 
38 namespace blender::ed::spreadsheet {
39 
43 
47 
48 } // namespace blender::ed::spreadsheet
static unsigned a[3]
Definition: RandGen.cpp:92
SpreadsheetColumn * spreadsheet_column_new(SpreadsheetColumnID *column_id)
SpreadsheetColumnID * spreadsheet_column_id_new()
void spreadsheet_column_free(SpreadsheetColumn *column)
void spreadsheet_column_id_free(SpreadsheetColumnID *column_id)
SpreadsheetColumnID * spreadsheet_column_id_copy(const SpreadsheetColumnID *src_column_id)
SpreadsheetColumn * spreadsheet_column_copy(const SpreadsheetColumn *src_column)
uint64_t get_default_hash(const T &v)
Definition: BLI_hash.hh:209
bool operator==(const SpreadsheetColumnID &a, const SpreadsheetColumnID &b)
unsigned __int64 uint64_t
Definition: stdint.h:93
uint64_t operator()(const SpreadsheetColumnID &column_id) const