1 /* Copyright (C) 2021 Free Software Foundation, Inc.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
21 #ifndef _INDEXOBJECT_H
22 #define _INDEXOBJECT_H
25 #include "Expression.h"
27 class IndexObject
: public Histable
30 IndexObject (int _indextype
, uint64_t _index
);
31 IndexObject (int _indextype
, Histable
*_obj
);
32 bool requires_string_sort (); // name column should be sorted using name text
40 virtual char *get_name (NameFormat
= NA
);
41 virtual void set_name (char*);
42 virtual void set_name_from_context (Expression::Context
*);
43 virtual Histable
*convertto (Histable_type
, Histable
* = NULL
);
63 // for use in index object definitions
64 static const uint64_t INDXOBJ_EXPGRID_SHIFT
= 60;
65 static const uint64_t INDXOBJ_EXPID_SHIFT
= 32;
66 static const uint64_t INDXOBJ_PAYLOAD_SHIFT
= 0;
67 static const uint64_t INDXOBJ_EXPGRID_MASK
=
68 ((1LLU << (64 - INDXOBJ_EXPGRID_SHIFT
)) - 1);
69 static const uint64_t INDXOBJ_EXPID_MASK
=
70 ((1LLU << (INDXOBJ_EXPGRID_SHIFT
- INDXOBJ_EXPID_SHIFT
)) - 1);
71 static const uint64_t INDXOBJ_PAYLOAD_MASK
=
72 ((1LLU << (INDXOBJ_EXPID_SHIFT
- INDXOBJ_PAYLOAD_SHIFT
)) - 1);
81 typedef enum IndexObjTypes
92 INDEX_LAST
// never used; marks the count of precompiled items
101 char *name
; // used as input
102 char *i18n_name
; // used for output
103 char *index_expr_str
;
104 Expression
*index_expr
;
106 char *short_description
;
107 char *long_description
;
108 MemObjType_t
*memObj
;
111 #endif /* _INDEXOBJECT_H */