Skip to content

Commit

Permalink
Remove absolute namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed Apr 12, 2018
1 parent 6c1b1cf commit c2cdc68
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 49 deletions.
12 changes: 6 additions & 6 deletions registry.cpp.tmpl
Expand Up @@ -62,7 +62,7 @@ ElementsDictionary create_public_dictionary()
return public_dictionary;
}

std::map<std::string, odil::Tag> create_public_tags()
std::map<std::string, Tag> create_public_tags()
{

RawElementsDictionaryEntry raw_entries[] = {
Expand All @@ -74,7 +74,7 @@ std::map<std::string, odil::Tag> create_public_tags()
{% endfor %}
};

std::map<std::string, odil::Tag> public_tags;
std::map<std::string, Tag> public_tags;

unsigned long const count = sizeof(raw_entries)/sizeof(RawElementsDictionaryEntry);
for(unsigned long i=0; i<count; ++i)
Expand Down Expand Up @@ -117,10 +117,10 @@ UIDsDictionary create_uids_dictionary()
return uids_dictionary;
}

}
ElementsDictionary public_dictionary=create_public_dictionary();
std::map<std::string, Tag> public_tags=create_public_tags();
UIDsDictionary uids_dictionary=create_uids_dictionary();

}

odil::ElementsDictionary odil::registry::public_dictionary=odil::registry::create_public_dictionary();
std::map<std::string, odil::Tag> odil::registry::public_tags=odil::registry::create_public_tags();
odil::UIDsDictionary odil::registry::uids_dictionary=odil::registry::create_uids_dictionary();
}
4 changes: 3 additions & 1 deletion src/odil/Association.cpp
Expand Up @@ -196,7 +196,9 @@ bool
Association
::is_associated() const
{
return this->_state_machine.get_transport().is_open() && this->_state_machine.get_state() == odil::dul::StateMachine::State::Sta6 ;
return (
this->_state_machine.get_transport().is_open()
&& this->_state_machine.get_state() == dul::StateMachine::State::Sta6);
}

void
Expand Down
4 changes: 2 additions & 2 deletions src/odil/MoveSCU.cpp
Expand Up @@ -216,11 +216,11 @@ ::_handle_store_association(
StoreSCP scp(association, store_callback);
scp.receive_and_process();
}
catch(odil::AssociationReleased const &)
catch(AssociationReleased const &)
{
result = true;
}
catch(odil::AssociationAborted const & e)
catch(AssociationAborted const & e)
{
result = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/odil/SCP.cpp
Expand Up @@ -26,7 +26,7 @@ SCP::Exception
::Exception(
std::string const & message,
Value::Integer status, std::shared_ptr<DataSet> status_fields)
: ::odil::Exception(message), status(status), status_fields(status_fields)
: odil::Exception(message), status(status), status_fields(status_fields)
{
// Nothing else.
}
Expand Down
12 changes: 6 additions & 6 deletions src/odil/VRFinder.cpp
Expand Up @@ -180,12 +180,12 @@ ::implicit_vr_little_endian(
tag == registry::LargestPixelValueInSeries ||
tag == registry::PixelPaddingValue)
{
if(!data_set->has(odil::registry::PixelRepresentation))
if(!data_set->has(registry::PixelRepresentation))
{
throw Exception("Cannot find VR without PixelRepresentation");
}
auto const & pixel_representation =
data_set->as_int(odil::registry::PixelRepresentation)[0];
data_set->as_int(registry::PixelRepresentation)[0];
return (pixel_representation==0)?(VR::US):(VR::SS);
}
else
Expand All @@ -212,12 +212,12 @@ ::explicit_vr_little_endian(
// PS3.5, A.1 (c)
if(tag == registry::PixelData)
{
if(!data_set->has(odil::registry::BitsAllocated))
if(!data_set->has(registry::BitsAllocated))
{
throw Exception("Cannot find VR without BitsAllocated");
}
auto const & bits_allocated =
data_set->as_int(odil::registry::BitsAllocated)[0];
data_set->as_int(registry::BitsAllocated)[0];
return (bits_allocated<=8)?(VR::OB):(VR::OW);
}
else if((tag.group>>8) == 0x60 && tag.element == 0x3000)
Expand Down Expand Up @@ -261,12 +261,12 @@ ::explicit_vr_little_endian(
tag == registry::LargestPixelValueInSeries ||
tag == registry::PixelPaddingValue)
{
if(!data_set->has(odil::registry::PixelRepresentation))
if(!data_set->has(registry::PixelRepresentation))
{
throw Exception("Cannot find VR without PixelRepresentation");
}
auto const & pixel_representation =
data_set->as_int(odil::registry::PixelRepresentation)[0];
data_set->as_int(registry::PixelRepresentation)[0];
return (pixel_representation==0)?(VR::US):(VR::SS);
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/odil/Writer.cpp
Expand Up @@ -219,7 +219,7 @@ void
Writer
::write_file(
std::shared_ptr<DataSet const> data_set , std::ostream & stream,
std::shared_ptr<odil::DataSet const> meta_information,
std::shared_ptr<DataSet const> meta_information,
std::string const & transfer_syntax, ItemEncoding item_encoding,
bool use_group_length)
{
Expand Down
4 changes: 2 additions & 2 deletions src/odil/dcmtk/Exception.cpp
Expand Up @@ -23,14 +23,14 @@ namespace dcmtk

Exception
::Exception(std::string const & message)
: ::odil::Exception(message), _source(Source::Message), _condition()
: odil::Exception(message), _source(Source::Message), _condition()
{
// Nothing else.
}

Exception
::Exception(OFCondition const & condition)
: ::odil::Exception(), _source(Source::Condition), _condition(condition)
: odil::Exception(), _source(Source::Condition), _condition(condition)
{
// Nothing else.
}
Expand Down
2 changes: 1 addition & 1 deletion src/odil/dcmtk/Exception.h
Expand Up @@ -21,7 +21,7 @@ namespace odil
namespace dcmtk
{

class ODIL_API Exception: public ::odil::Exception
class ODIL_API Exception: public odil::Exception
{
public:
/**
Expand Down
2 changes: 1 addition & 1 deletion src/odil/json_converter.h
Expand Up @@ -21,7 +21,7 @@ namespace odil
/// @brief Convert a data set to its JSON representation.
ODIL_API Json::Value as_json(
std::shared_ptr<DataSet const> data_set,
odil::Value::Strings const & specific_character_set={});
Value::Strings const & specific_character_set={});

/// @brief Create a data set from its JSON representation.
ODIL_API std::shared_ptr<DataSet> as_dataset(Json::Value const & json);
Expand Down
2 changes: 1 addition & 1 deletion src/odil/message/NSetRequest.cpp
Expand Up @@ -27,7 +27,7 @@ ::NSetRequest(
std::shared_ptr<DataSet> dataset)
: Request(message_id)
{
this->set_command_field( ::odil::message::Message::Command::N_SET_RQ);
this->set_command_field(Message::Command::N_SET_RQ);
this->set_requested_sop_class_uid(requested_sop_class_uid);
this->set_requested_sop_instance_uid(requested_sop_instance_uid);

Expand Down
4 changes: 2 additions & 2 deletions src/odil/message/Response.h
Expand Up @@ -91,9 +91,9 @@ class ODIL_API Response: public Message
ODIL_MESSAGE_OPTIONAL_FIELD_INTEGER_MACRO(
error_id, registry::ErrorID)
ODIL_MESSAGE_OPTIONAL_FIELD_STRING_MACRO(
affected_sop_instance_uid, odil::registry::AffectedSOPInstanceUID)
affected_sop_instance_uid, registry::AffectedSOPInstanceUID)
ODIL_MESSAGE_OPTIONAL_FIELD_STRING_MACRO(
attribute_identifier_list, odil::registry::AttributeIdentifierList)
attribute_identifier_list, registry::AttributeIdentifierList)

/// @brief Test whether the status class is pending.
bool is_pending() const;
Expand Down
20 changes: 10 additions & 10 deletions src/odil/pdu/Item.cpp
Expand Up @@ -73,7 +73,7 @@ ::as_unsigned_int_8() const
{
if(this->_type != Type::unsigned_int_8)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_uint8;
}
Expand All @@ -84,7 +84,7 @@ ::as_unsigned_int_8()
{
if(this->_type != Type::unsigned_int_8)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_uint8;
}
Expand All @@ -95,7 +95,7 @@ ::as_unsigned_int_16() const
{
if(this->_type != Type::unsigned_int_16)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_uint16;
}
Expand All @@ -106,7 +106,7 @@ ::as_unsigned_int_16()
{
if(this->_type != Type::unsigned_int_16)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_uint16;
}
Expand All @@ -117,7 +117,7 @@ ::as_unsigned_int_32() const
{
if(this->_type != Type::unsigned_int_32)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_uint32;
}
Expand All @@ -128,7 +128,7 @@ ::as_unsigned_int_32()
{
if(this->_type != Type::unsigned_int_32)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_uint32;
}
Expand All @@ -139,7 +139,7 @@ ::as_string() const
{
if(this->_type != Type::string)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_string;
}
Expand All @@ -150,7 +150,7 @@ ::as_string()
{
if(this->_type != Type::string)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_string;
}
Expand All @@ -161,7 +161,7 @@ ::as_items() const
{
if(this->_type != Type::items)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_items;
}
Expand All @@ -172,7 +172,7 @@ ::as_items()
{
if(this->_type != Type::items)
{
throw odil::Exception("Incorrect type");
throw Exception("Incorrect type");
}
return this->_items;
}
Expand Down
8 changes: 4 additions & 4 deletions src/odil/registry.cpp
Expand Up @@ -13409,10 +13409,10 @@ UIDsDictionary create_uids_dictionary()
return uids_dictionary;
}

}
ElementsDictionary public_dictionary=create_public_dictionary();
std::map<std::string, Tag> public_tags=create_public_tags();
UIDsDictionary uids_dictionary=create_uids_dictionary();

}

odil::ElementsDictionary odil::registry::public_dictionary=odil::registry::create_public_dictionary();
std::map<std::string, odil::Tag> odil::registry::public_tags=odil::registry::create_public_tags();
odil::UIDsDictionary odil::registry::uids_dictionary=odil::registry::create_uids_dictionary();
}
4 changes: 2 additions & 2 deletions src/odil/webservices/QIDORSRequest.cpp
Expand Up @@ -235,7 +235,7 @@ add_qido_element(
Tag const tag(*it);
if(!current_ds->has(tag))
{
current_ds->add(tag, {std::make_shared<odil::DataSet>()});
current_ds->add(tag, {std::make_shared<DataSet>()});
}
current_ds = current_ds->as_data_set(tag)[0];
}
Expand Down Expand Up @@ -475,7 +475,7 @@ ::_generate_url(bool numerical_tags)
{
// Breadth-first walk of the query data set to generate the query terms
// (e.g. PatientName=Doe) and the include fields
std::queue<std::pair<std::shared_ptr<odil::DataSet const>, std::string>> queue;
std::queue<std::pair<std::shared_ptr<DataSet const>, std::string>> queue;
queue.emplace(std::make_pair(this->_query_data_set, ""));

std::vector<std::string> terms;
Expand Down
4 changes: 2 additions & 2 deletions src/odil/webservices/QIDORSRequest.h
Expand Up @@ -66,7 +66,7 @@ class ODIL_API QIDORSRequest
std::shared_ptr<DataSet const> get_query_data_set() const;

/// @brief Return the wanted fields.
std::set<std::vector<odil::Tag>> const & get_includefields() const;
std::set<std::vector<Tag>> const & get_includefields() const;

/// @brief Return whether fuzzymatching is wanted or not.
bool get_fuzzymatching() const;
Expand Down Expand Up @@ -107,7 +107,7 @@ class ODIL_API QIDORSRequest
static bool _is_selector_valid (Selector const & selector);

/// @brief Return the tag as a numerical string or as a "string"
static std::string _tag_to_string(odil::Tag const & tag, bool numerical_tag);
static std::string _tag_to_string(Tag const & tag, bool numerical_tag);

/// @brief Split an URL into a tuple
void _from_url(URL const & url);
Expand Down
2 changes: 1 addition & 1 deletion src/odil/webservices/QIDORSResponse.cpp
Expand Up @@ -157,7 +157,7 @@ ::set_data_sets(Value::DataSets const & data_sets)
this->_data_sets = data_sets;
}

odil::webservices::Representation const &
Representation const &
QIDORSResponse
::get_representation() const
{
Expand Down
10 changes: 5 additions & 5 deletions src/odil/webservices/STOWRSRequest.cpp
Expand Up @@ -340,7 +340,7 @@ ::get_http_request() const
{
std::string buffer;
OStringStream stream(buffer);
odil::Writer::write_file(data_set, stream);
Writer::write_file(data_set, stream);
stream.flush();

return Message(
Expand Down Expand Up @@ -567,7 +567,7 @@ ::_extract_bulk_data(
// 2. Get Transfer Syntax from dataSet
std::string const & transfer_syntax =
data_set->get_transfer_syntax().empty()
?odil::registry::ExplicitVRLittleEndian
?registry::ExplicitVRLittleEndian
:data_set->get_transfer_syntax();

// 3. Create a new BulkData
Expand Down Expand Up @@ -612,7 +612,7 @@ ::_restore_data_set(std::shared_ptr<DataSet> data_set, BulkMap & bulk_map)
{
auto & tag = it.first;
auto & element = it.second;
if(element.vr == odil::VR::UR)
if(element.vr == VR::UR)
{
auto const bulk_map_it = bulk_map.find(element.as_string()[0]);
if(bulk_map_it != bulk_map.end())
Expand All @@ -621,10 +621,10 @@ ::_restore_data_set(std::shared_ptr<DataSet> data_set, BulkMap & bulk_map)
data_set->get_transfer_syntax().empty()
?registry::ExplicitVRLittleEndian
:data_set->get_transfer_syntax();
odil::VRFinder vr_finder;
VRFinder vr_finder;
auto const vr = vr_finder(tag, data_set, transfer_syntax);

data_set->add(tag, odil::Value::Binary({bulk_map_it->second}), vr);
data_set->add(tag, Value::Binary({bulk_map_it->second}), vr);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/odil/webservices/WADORSRequest.cpp
Expand Up @@ -277,7 +277,7 @@ ::get_type() const
return this->_type;
}

odil::webservices::Selector const &
Selector const &
WADORSRequest
::get_selector() const
{
Expand Down

0 comments on commit c2cdc68

Please sign in to comment.