clearStatistics();
}
+void
+CSVLeaseFile4::close() {
+ if (MultiThreadingMgr::instance().getMode()) {
+ std::lock_guard<std::mutex> lock(mutex_);
+ closeInternal();
+ } else {
+ closeInternal();
+ }
+}
+
+void
+CSVLeaseFile4::closeInternal() {
+ // Call the base class to close the file
+ VersionedCSVFile::close();
+}
+
void
CSVLeaseFile4::append(const Lease4& lease) {
if (MultiThreadingMgr::instance().getMode()) {
/// the base class may do so.
virtual void open(const bool seek_to_end = false);
+ /// @brief Closes the lease file.
+ virtual void close();
+
/// @brief Appends the lease record to the CSV file.
///
/// This function doesn't throw exceptions itself. In theory, exceptions
/// the base class may do so.
virtual void openInternal(const bool seek_to_end = false);
+ /// @brief Closes the lease file.
+ ///
+ /// Should be called in a thread safe context.
+ virtual void closeInternal();
+
/// @brief Appends the lease record to the CSV file.
///
/// Should be called in a thread safe context.
}
}
+void
+CSVLeaseFile6::close() {
+ if (MultiThreadingMgr::instance().getMode()) {
+ std::lock_guard<std::mutex> lock(mutex_);
+ closeInternal();
+ } else {
+ closeInternal();
+ }
+}
+
+void
+CSVLeaseFile6::closeInternal() {
+ // Call the base class to close the file
+ VersionedCSVFile::close();
+}
+
void
CSVLeaseFile6::openInternal(const bool seek_to_end) {
// Call the base class to open the file
/// the base class may do so.
virtual void open(const bool seek_to_end = false);
+ /// @brief Closes the lease file.
+ virtual void close();
+
/// @brief Appends the lease record to the CSV file.
///
/// This function doesn't throw exceptions itself. In theory, exceptions
/// the base class may do so.
virtual void openInternal(const bool seek_to_end = false);
+ /// @brief Closes the lease file.
+ ///
+ /// Should be called in a thread safe context.
+ virtual void closeInternal();
+
/// @brief Appends the lease record to the CSV file.
///
/// Should be called in a thread safe context.
void append(const CSVRow& row) const;
/// @brief Closes the CSV file.
- void close();
+ virtual void close();
/// @brief Checks if the CSV file exists and can be opened for reading.
///