2#ifndef STORMM_MOLOBJ_DATAITEM_H
3#define STORMM_MOLOBJ_DATAITEM_H
8#include "Constants/behavior.h"
9#include "DataTypes/stormm_vector_types.h"
10#include "Parsing/textfile.h"
11#include "Potential/energy_enumerators.h"
12#include "molecule_format_enumerators.h"
13#include "mdlmol_request.h"
18using constants::ExceptionResponse;
19using constants::ModificationPolicy;
64 const std::string &external_regno_in = std::string(
""),
65 int internal_regno_in = -1,
int maccs_ii_number_in = -1, uint header_info = 0U,
66 const std::vector<std::string> &body_in = {},
67 ModificationPolicy mpol = ModificationPolicy::DO_NOT_MODIFY,
68 ExceptionResponse notify = ExceptionResponse::WARN);
71 int compound_line_end = -1,
const std::string &title = std::string(
""),
72 ModificationPolicy mpol = ModificationPolicy::DO_NOT_MODIFY,
73 ExceptionResponse notify = ExceptionResponse::WARN);
76 ModificationPolicy mpol = ModificationPolicy::DO_NOT_MODIFY,
77 ExceptionResponse notify = ExceptionResponse::WARN);
137 const std::string&
getDataLine(
const int line_index)
const;
140 const std::vector<std::string>&
getBody()
const;
144 MdlMolDataItemKind
getKind()
const;
161 std::string
parseString(
int element_number,
int line_number)
const;
162 std::string
parseString(
int start_pos,
int length,
int line_number)
const;
168 llint
parseInteger(
int element_number,
int line_number)
const;
169 llint
parseInteger(
int start_pos,
int length,
int line_number)
const;
175 ullint
parseUnsigned(
int element_number,
int line_number)
const;
176 ullint
parseUnsigned(
int start_pos,
int length,
int line_number)
const;
182 double parseReal(
int element_number,
int line_number)
const;
183 double parseReal(
int start_pos,
int length,
int line_number)
const;
199 bool matchItemName(
const std::string &item_name_comp,
const std::string &ext_regno_comp,
200 int maccs_ii_no_comp = -1)
const;
202 bool matchItemName(
const std::string &item_name_comp,
int maccs_ii_no_comp = -1)
const;
204 bool matchRegistryNumber(
const std::string &ext_regno_comp,
int maccs_ii_no_comp = -1)
const;
206 bool matchMaccsField(
int maccs_ii_no_comp)
const;
216 ModificationPolicy mpol = ModificationPolicy::DO_NOT_MODIFY,
217 ExceptionResponse notify = ExceptionResponse::WARN);
226 MdlMolDataItemKind kind;
230 StateVariable tracked_state;
233 std::string item_name;
235 std::string output_item_name;
237 std::string external_regno;
241 bool use_internal_regno;
243 bool use_external_regno;
245 bool use_maccs_ii_number;
250 std::vector<std::string> body;
253 void validateItemName(ModificationPolicy mpol = ModificationPolicy::DO_NOT_MODIFY,
254 ExceptionResponse notify = ExceptionResponse::WARN);
271uint getDataItemHeaderCode(
bool use_internal_regno =
false,
bool use_external_regno =
false,
272 bool use_item_name =
true,
bool use_maccs_ii_field =
false,
273 bool state_from_archives =
false);
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45
int getInternalRegistryNumber() const
Get the internal registry number. This will return -1 if no such registry number exists.
Definition mdlmol_dataitem.cpp:257
int getDataLineCount() const
Get the data line count.
Definition mdlmol_dataitem.cpp:272
const std::vector< std::string > & getBody() const
Get all data lines.
Definition mdlmol_dataitem.cpp:286
void addDataLine(const std::string &text)
Add a line to the data item.
Definition mdlmol_dataitem.cpp:494
std::string parseString(int element_number, int line_number) const
Retrieve a string from the data lines of a data item, assuming that individual words on each line are...
Definition mdlmol_dataitem.cpp:296
MdlMolDataItem(const MdlMolDataItem &original)=default
The default copy and move constructors, as well as copy and move assignment operators,...
const std::string & getItemName() const
Get a const reference to the item name, if it exists. If there is no item name, a const reference to ...
Definition mdlmol_dataitem.cpp:242
llint parseInteger(int element_number, int line_number) const
Retrieve a signed integer from the data lines of a data item. The assumptions of parseString() above ...
Definition mdlmol_dataitem.cpp:341
bool placeTitleInHeader() const
Indicate whether to display the data item name (title) in the header line, between angular brackets.
Definition mdlmol_dataitem.cpp:227
bool placeMaccsIIFieldInHeader() const
Indicate whether to display the MACCS-II field number in the header.
Definition mdlmol_dataitem.cpp:232
int getMaccsFieldNumber() const
Get the MACCS-II database field number.
Definition mdlmol_dataitem.cpp:262
bool matchItemName(const std::string &item_name_comp, const std::string &ext_regno_comp, int maccs_ii_no_comp=-1) const
Match this data item with a series of identification tags.
Definition mdlmol_dataitem.cpp:459
bool placeExternalRegnoInHeader() const
Indicate whether to display the (user-supplied) external identification number in the header line.
Definition mdlmol_dataitem.cpp:222
double parseReal(int element_number, int line_number) const
Retrieve a real number from the data lines of a data item. The assumptions of parseString() above app...
Definition mdlmol_dataitem.cpp:398
bool placeInternalRegnoInHeader() const
Indicate whether to display the internal identification number (based on the position of the molecule...
Definition mdlmol_dataitem.cpp:217
ullint parseUnsigned(int element_number, int line_number) const
Retrieve an unsigned integer from the data lines of a data item. The assumptions of parseString() abo...
Definition mdlmol_dataitem.cpp:369
StateVariable getTrackedState() const
Get the state variable enumeration for this data item. This is used in the case of a STATE_VARIABLE k...
Definition mdlmol_dataitem.cpp:267
const std::string & getOutputItemName() const
Get a const reference to the output item name, if it exists. If there is no item name,...
Definition mdlmol_dataitem.cpp:247
bool noteArchivesInHeader() const
Indicate that the "FROM ARCHIVES" tag should go in the header line.
Definition mdlmol_dataitem.cpp:237
char4 parseChar4(int element_number, int line_number) const
Retrieve a tuple of four characters from the data lines of a data item. Assumptions from parseString(...
Definition mdlmol_dataitem.cpp:429
void setItemName(const std::string &item_name_in, ModificationPolicy mpol=ModificationPolicy::DO_NOT_MODIFY, ExceptionResponse notify=ExceptionResponse::WARN)
Set the item name and apply checks to the result.
Definition mdlmol_dataitem.cpp:487
const std::string & getDataLine(const int line_index) const
Get a particular data lines from the item body.
Definition mdlmol_dataitem.cpp:277
MdlMolDataItem(const std::string &item_name_in=std::string(""), const std::string &external_regno_in=std::string(""), int internal_regno_in=-1, int maccs_ii_number_in=-1, uint header_info=0U, const std::vector< std::string > &body_in={}, ModificationPolicy mpol=ModificationPolicy::DO_NOT_MODIFY, ExceptionResponse notify=ExceptionResponse::WARN)
The constructor takes the original text file and the number of the first line of the data item,...
Definition mdlmol_dataitem.cpp:19
const std::string & getExternalRegistryNumber() const
Get the external registry number.
Definition mdlmol_dataitem.cpp:252
MdlMolDataItemKind getKind() const
Get the custom data item type. Here, the "NATIVE" code indicates that no custom enumeration is presen...
Definition mdlmol_dataitem.cpp:291
A request for one of a sanctioned list of information types to be included in a data item of an SD fi...
Definition mdlmol_request.h:20
Definition stormm_vector_types.h:141