MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / resetFilePointers

Method resetFilePointers

SRC/database/FileDatastore.cpp:127–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125
126
127void
128FileDatastore::resetFilePointers(void) {
129
130 for (theIDFilesIter = theIDFiles.begin(); theIDFilesIter != theIDFiles.end(); theIDFilesIter++) {
131 FileDatastoreOutputFile *theFileStruct = theIDFilesIter->second;
132 fstream *theFile = theFileStruct->theFile;
133 if (theFile != 0) {
134 theFile->seekp(0, ios::beg);
135 *(theIntData.dbTag) = theFileStruct->maxDbTag;
136 theFile->write(data, sizeof(int));
137 theFile->close();
138 delete theFile;
139 theFileStruct->theFile = 0;
140 }
141 }
142
143 for (theMatFilesIter = theMatFiles.begin(); theMatFilesIter != theMatFiles.end(); theMatFilesIter++) {
144 FileDatastoreOutputFile *theFileStruct = theMatFilesIter->second;
145 fstream *theFile = theFileStruct->theFile;
146 if (theFile != 0) {
147 theFile->seekp(0, ios::beg);
148 *(theIntData.dbTag) = theFileStruct->maxDbTag;
149 theFile->write(data, sizeof(int));
150 theFile->close();
151 delete theFile;
152 theFileStruct->theFile = 0;
153 }
154 }
155
156 for (theVectFilesIter = theVectFiles.begin(); theVectFilesIter != theVectFiles.end(); theVectFilesIter++) {
157 FileDatastoreOutputFile *theFileStruct = theVectFilesIter->second;
158 fstream *theFile = theFileStruct->theFile;
159 if (theFile != 0) {
160 theFile->seekp(0, ios::beg);
161 *(theIntData.dbTag) = theFileStruct->maxDbTag;
162 theFile->write(data, sizeof(int));
163 theFile->close();
164 delete theFile;
165 theFileStruct->theFile = 0;
166 }
167 }
168 currentCommitTag = -1;
169}
170
171
172int

Callers 6

sendIDMethod · 0.95
recvIDMethod · 0.95
sendMatrixMethod · 0.95
recvMatrixMethod · 0.95
sendVectorMethod · 0.95
recvVectorMethod · 0.95

Calls 4

beginMethod · 0.45
endMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected