19
19
#ifndef __molecule_sgroups__
20
20
#define __molecule_sgroups__
21
21
22
+ #include < memory>
23
+
22
24
#include " base_cpp/array.h"
23
25
#include " base_cpp/obj_pool.h"
24
26
#include " base_cpp/ptr_pool.h"
@@ -99,7 +101,13 @@ namespace indigo
99
101
};
100
102
101
103
SGroup ();
102
- virtual ~SGroup ();
104
+ SGroup (const SGroup&) = delete ;
105
+ SGroup (SGroup&&) noexcept = default ;
106
+
107
+ virtual ~SGroup () = default ;
108
+
109
+ SGroup& operator =(const SGroup&) = delete ;
110
+ SGroup& operator =(SGroup&&) noexcept = default ;
103
111
104
112
int sgroup_type; // group type, represnted with STY in Molfile format
105
113
int sgroup_subtype; // group subtype, represnted with SST in Molfile format
@@ -116,16 +124,17 @@ namespace indigo
116
124
117
125
static const char * typeToString (int sg_type);
118
126
static int getType (const char * sg_type);
119
-
120
- private:
121
- SGroup (const SGroup&);
122
127
};
123
128
124
129
class DLLEXPORT DataSGroup : public SGroup
125
130
{
126
131
public:
127
132
DataSGroup ();
128
- ~DataSGroup () override ;
133
+ DataSGroup (const DataSGroup&) = delete ;
134
+ DataSGroup (DataSGroup&&) noexcept = default ;
135
+
136
+ DataSGroup& operator =(const DataSGroup&) = delete ;
137
+ DataSGroup& operator =(DataSGroup&&) noexcept = default ;
129
138
130
139
Array<char > description; // SDT in Molfile format (filed units or format)
131
140
Array<char > name; // SDT in Molfile format (field name)
@@ -140,15 +149,17 @@ namespace indigo
140
149
int num_chars; // number of characters
141
150
int dasp_pos;
142
151
char tag; // tag
143
- private:
144
- DataSGroup (const DataSGroup&);
145
152
};
146
153
147
154
class DLLEXPORT Superatom : public SGroup
148
155
{
149
156
public:
150
157
Superatom ();
151
- ~Superatom () override ;
158
+ Superatom (const Superatom&) = delete ;
159
+ Superatom (Superatom&&) noexcept = default ;
160
+
161
+ Superatom& operator =(const Superatom&) = delete ;
162
+ Superatom& operator =(Superatom&&) noexcept = default ;
152
163
153
164
Array<char > subscript; // SMT in Molfile format
154
165
Array<char > sa_class; // SCL in Molfile format
@@ -163,7 +174,9 @@ namespace indigo
163
174
int lvidx;
164
175
Array<char > apid;
165
176
};
166
- ObjPool<_AttachmentPoint> attachment_points; // SAP in Molfile format
177
+ const ObjPool<_AttachmentPoint>& getAttachmentPoints () const ;
178
+ ObjPool<_AttachmentPoint>& getAttachmentPoints ();
179
+ bool hasAttachmentPoints () const ;
167
180
168
181
struct _BondConnection
169
182
{
@@ -173,40 +186,47 @@ namespace indigo
173
186
Array<_BondConnection> bond_connections; // SBV in Molfile format
174
187
175
188
private:
176
- Superatom ( const Superatom&);
189
+ mutable std::unique_ptr<ObjPool<_AttachmentPoint>> _attachment_points; // SAP in Molfile format
177
190
};
178
191
179
192
class DLLEXPORT RepeatingUnit : public SGroup
180
193
{
181
194
public:
182
195
RepeatingUnit ();
183
- ~RepeatingUnit () override ;
196
+ RepeatingUnit (const RepeatingUnit&) = delete ;
197
+ RepeatingUnit (RepeatingUnit&&) noexcept = default ;
198
+
199
+ RepeatingUnit& operator =(const RepeatingUnit&) = delete ;
200
+ RepeatingUnit& operator =(RepeatingUnit&&) noexcept = default ;
184
201
185
202
int connectivity;
186
203
Array<char > subscript; // SMT in Molfile format
187
- private:
188
- RepeatingUnit (const RepeatingUnit&);
189
204
};
190
205
191
206
class DLLEXPORT MultipleGroup : public SGroup
192
207
{
193
208
public:
194
209
MultipleGroup ();
195
- ~MultipleGroup () override ;
210
+ MultipleGroup (const MultipleGroup&) = delete ;
211
+ MultipleGroup (MultipleGroup&&) noexcept = default ;
212
+
213
+ MultipleGroup& operator =(const MultipleGroup&) = delete ;
214
+ MultipleGroup& operator =(MultipleGroup&&) noexcept = default ;
196
215
197
216
Array<int > parent_atoms;
198
217
int multiplier;
199
-
200
- private:
201
- MultipleGroup (const MultipleGroup&);
202
218
};
203
219
204
220
class Tree ;
205
221
class DLLEXPORT MoleculeSGroups
206
222
{
207
223
public:
208
224
MoleculeSGroups ();
209
- ~MoleculeSGroups ();
225
+ MoleculeSGroups (const MoleculeSGroups&) = delete ;
226
+ MoleculeSGroups (MoleculeSGroups&&) noexcept = default ;
227
+
228
+ MoleculeSGroups& operator =(const MoleculeSGroups&) = delete ;
229
+ MoleculeSGroups& operator =(MoleculeSGroups&&) noexcept = default ;
210
230
211
231
DECL_ERROR;
212
232
@@ -248,7 +268,7 @@ namespace indigo
248
268
void registerUnfoldedHydrogen (int idx, int new_h_idx);
249
269
250
270
protected:
251
- PtrPool<SGroup> _sgroups;
271
+ std::unique_ptr< PtrPool<SGroup> > _sgroups;
252
272
253
273
private:
254
274
int _findSGroupById (int id);
0 commit comments