-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[c++] Remove spdlog
requirement
#1852
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* @file array_buffers.cc | ||
* | ||
* @section LICENSE | ||
* | ||
* The MIT License | ||
* | ||
* @copyright Copyright (c) 2022 TileDB, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
* | ||
* @section DESCRIPTION | ||
* | ||
* This file defines the ArrayBuffers class. | ||
*/ | ||
|
||
#include "array_buffers.h" | ||
#include "../utils/logger.h" | ||
|
||
namespace tiledbsoma { | ||
|
||
using namespace tiledb; | ||
|
||
std::shared_ptr<ColumnBuffer> ArrayBuffers::at(const std::string& name) { | ||
if (!contains(name)) { | ||
throw TileDBSOMAError( | ||
fmt::format("[ArrayBuffers] column '{}' does not exist", name)); | ||
} | ||
return buffers_[name]; | ||
} | ||
|
||
void ArrayBuffers::emplace( | ||
const std::string& name, std::shared_ptr<ColumnBuffer> buffer) { | ||
if (contains(name)) { | ||
throw TileDBSOMAError( | ||
fmt::format("[ArrayBuffers] column '{}' already exists", name)); | ||
} | ||
names_.push_back(name); | ||
buffers_.emplace(name, buffer); | ||
} | ||
|
||
} // namespace tiledbsoma |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,6 @@ | |
#include <tiledb/tiledb_experimental> | ||
|
||
#include "../utils/common.h" | ||
#include "../utils/logger.h" | ||
#include "span/span.hpp" | ||
|
||
namespace tiledbsoma { | ||
|
@@ -128,9 +127,7 @@ class ColumnBuffer { | |
ColumnBuffer(const ColumnBuffer&) = delete; | ||
ColumnBuffer(ColumnBuffer&&) = default; | ||
|
||
~ColumnBuffer() { | ||
LOG_TRACE(fmt::format("[ColumnBuffer] release '{}'", name_)); | ||
} | ||
~ColumnBuffer(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? While There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's because of |
||
|
||
/** | ||
* @brief Attach this ColumnBuffer to a TileDB query. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why were these headers added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.h
is used for theLOG_*
macros andfmt
.carrow.h
is used forArrowSchema
.soma_array.h
use to includelogger.h
but that has now been removed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But
soma_array.h
includeslogger_public.h
. Isn't it enough?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,
logger_public.h
does not exposefmt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW one can (somewhat poorly) drop in
tinyfmt
which is a less powerful thanfmt
but a single-header C++11 library. The key is, as @nguyenv points out, that the public logger only takes a string (orconst char*
, I forgot) to 'report' and does no formatting whatsoever itself.