Skip to content

Commit d571a4f

Browse files
Merge pull request #38706 from rosswhitfield/remove_unused_NeXusFile_methods
Remove unused methods from NeXusFile - ornl-next
2 parents f0b92e8 + 2c5fce2 commit d571a4f

File tree

5 files changed

+16
-664
lines changed

5 files changed

+16
-664
lines changed

Framework/DataHandling/src/CreateSimulationWorkspace.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -268,21 +268,18 @@ void CreateSimulationWorkspace::loadMappingFromISISNXS(const std::string &filena
268268
} catch (::NeXus::Exception &) {
269269
throw std::runtime_error("Cannot find path to isis_vms_compat. Is the file an ISIS NeXus file?");
270270
}
271-
using NXIntArray = std::unique_ptr<std::vector<int32_t>>;
271+
using NXIntArray = std::vector<int32_t>;
272272

273-
nxsFile.openData("NDET");
274-
NXIntArray ndets(nxsFile.getData<int32_t>());
275-
nxsFile.closeData();
273+
NXIntArray ndets;
274+
nxsFile.readData("NDET", ndets);
276275

277-
nxsFile.openData("SPEC");
278-
NXIntArray specTable(nxsFile.getData<int32_t>());
279-
nxsFile.closeData();
276+
NXIntArray specTable;
277+
nxsFile.readData("SPEC", specTable);
280278

281-
nxsFile.openData("UDET");
282-
NXIntArray udetTable(nxsFile.getData<int32_t>());
283-
nxsFile.closeData();
279+
NXIntArray udetTable;
280+
nxsFile.readData("UDET", udetTable);
284281

285-
createGroupingsFromTables(specTable->data(), udetTable->data(), (*ndets)[0]);
282+
createGroupingsFromTables(specTable.data(), udetTable.data(), ndets[0]);
286283
}
287284

288285
/**

Framework/NexusCpp/inc/MantidNexusCpp/NeXusFile.hpp

Lines changed: 0 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,6 @@ class MANTID_NEXUSCPP_DLL File {
115115
*/
116116
void initAttrDir();
117117

118-
/**
119-
* Function to walk the file tree and fill in the TypeMap.
120-
*
121-
* \param path the current path in the file
122-
* \param class_name the current NX class name
123-
* \param tmap the typemap being constructed
124-
*/
125-
void walkFileForTypeMap(const std::string &path, const std::string &class_name, TypeMap &tmap);
126-
127-
/**
128-
* Function to append new path to current one.
129-
* \param currpath the current path to append to
130-
* \param subpath the path to append to the current path
131-
* \return the newly joined path
132-
*/
133-
const std::string makeCurrentPath(const std::string &currpath, const std::string &subpath);
134-
135118
/**
136119
* Function to consolidate the file opening code for the various constructors
137120
* \param filename The name of the file to open.
@@ -173,10 +156,6 @@ class MANTID_NEXUSCPP_DLL File {
173156
/** Flush the file. */
174157
void flush();
175158

176-
template <typename NumT> void malloc(NumT *&data, const Info &info);
177-
178-
template <typename NumT> void free(NumT *&data);
179-
180159
/**
181160
* Create a new group.
182161
*
@@ -204,14 +183,6 @@ class MANTID_NEXUSCPP_DLL File {
204183
*/
205184
void openPath(const std::string &path);
206185

207-
/**
208-
* Open the group in which the NeXus object with the specified path exists.
209-
*
210-
* \param path A unix like path string to a group or field. The path
211-
* string is a list of group names and SDS names separated with a slash,
212-
* '/' (i.e. "/entry/sample/name").
213-
*/
214-
void openGroupPath(const std::string &path);
215186
/**
216187
* Get the path into the current file
217188
* \return A unix like path string pointing to the current
@@ -431,22 +402,6 @@ class MANTID_NEXUSCPP_DLL File {
431402
*/
432403
void putAttr(const AttrInfo &info, const void *data);
433404

434-
/**
435-
* Put the supplied data as an attribute into the currently open data.
436-
*
437-
* \param name Name of the attribute to add.
438-
* \param array The attribute value.
439-
*/
440-
void putAttr(const std::string &name, const std::vector<std::string> &array);
441-
442-
/**
443-
* Put the supplied data as an attribute into the currently open data.
444-
*
445-
* \param name Name of the attribute to add.
446-
* \param array The attribute value.
447-
*/
448-
template <typename NumT> void putAttr(const std::string &name, const std::vector<NumT> &array);
449-
450405
/**
451406
* Put the supplied data as an attribute into the currently open data.
452407
*
@@ -532,37 +487,13 @@ class MANTID_NEXUSCPP_DLL File {
532487
*/
533488
void makeLink(NXlink &link);
534489

535-
/**
536-
* Create a link with a new name.
537-
*
538-
* \param name The name of this copy of the link.
539-
* \param link The object (group or data) in the file to link to.
540-
*/
541-
void makeNamedLink(const std::string &name, NXlink &link);
542-
543-
/**
544-
* Open the original copy of this group or data as declared by the
545-
* "target" attribute.
546-
*/
547-
void openSourceGroup();
548-
549490
/**
550491
* Put the currently open data in the supplied pointer.
551492
*
552493
* \param data The pointer to copy the data to.
553494
*/
554495
void getData(void *data);
555496

556-
/**
557-
* Allocate memory and return the data as a vector. Since this
558-
* does call "new vector<NumT>" the caller is responsible for
559-
* calling "delete".
560-
* \tparam NumT numeric data type of result
561-
*
562-
* \return The data as a vector.
563-
*/
564-
template <typename NumT> std::vector<NumT> *getData();
565-
566497
/**
567498
* Put data into the supplied vector. The vector does not need to
568499
* be the correct size, just the correct type as it is resized to
@@ -714,87 +645,16 @@ class MANTID_NEXUSCPP_DLL File {
714645
*/
715646
std::string getStrAttr(const AttrInfo &info);
716647

717-
/**
718-
* Get the value of a string array attribute.
719-
*
720-
* \param info Which attribute to read.
721-
*
722-
* \param array The values of the attribute.
723-
*/
724-
void getAttr(const std::string &name, std::vector<std::string> &array);
725-
726648
/**
727649
* \return The id of the group used for linking.
728650
*/
729651
NXlink getGroupID();
730652

731-
/**
732-
* Determine whether or not two links refer to the same data or group.
733-
*
734-
* \param first The first link information to compare.
735-
* \param second The second link information to compare.
736-
*
737-
* \return True if the two point at the same data or group.
738-
*/
739-
bool sameID(NXlink &first, NXlink &second);
740-
741-
/**
742-
* Diagnostic print of the link information.
743-
*
744-
* \param link The link to print to stdout.
745-
*/
746-
void printLink(NXlink &link);
747-
748-
/**
749-
* Set the number format used for a particular type when using the
750-
* xml base. This is ignore in the other bases.
751-
*
752-
* \param type The primitive type to set the format for.
753-
* \param format The format to use.
754-
*/
755-
void setNumberFormat(NXnumtype &type, const std::string &format);
756-
757-
/**
758-
* Find out the name of the file this object is holding onto.
759-
*
760-
* \param buff_length The size of the buffer to use for reading the name.
761-
*
762-
* \return The name of the file.
763-
*/
764-
std::string inquireFile(const int buff_length = NX_MAXPATHLEN);
765-
766-
/**
767-
* Determine Whether or not a supplied group is external.
768-
*
769-
* \param name The name of the group to check.
770-
* \param type The type of the group to check.
771-
* \param buff_length The size of the buffer to use for reading the url.
772-
*
773-
* \return The url to the external group.
774-
*/
775-
std::string isExternalGroup(const std::string &name, const std::string &type,
776-
const unsigned buff_length = NX_MAXNAMELEN);
777-
778-
/**
779-
* Create a link to a group in an external file.
780-
*
781-
* \param name The name for the group in this file.
782-
* \param type The type for the group in this file.
783-
* \param url The url to the group in the external file.
784-
*/
785-
void linkExternal(const std::string &name, const std::string &type, const std::string &url);
786653
/**
787654
* This function checksi if we are in an open dataset
788655
* \returns true if we are currently in an open dataset else false
789656
*/
790657
bool isDataSetOpen();
791-
792-
/**
793-
* Create a multimap with the data types as keys and the associated paths as values.
794-
*
795-
* \return The multimap of the opened file.
796-
*/
797-
TypeMap *getTypeMap();
798658
};
799659

800660
/**

0 commit comments

Comments
 (0)