-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1225 from germasch/cleanup
Cleanup: use regular templates in .tcc for Attribute, Variable
- Loading branch information
Showing
9 changed files
with
368 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Distributed under the OSI-approved Apache License, Version 2.0. See | ||
* accompanying file Copyright.txt for details. | ||
* | ||
* Attribute.tcc : | ||
* | ||
* Created on: Jun 4, 2018 | ||
* Author: William F Godoy [email protected] | ||
*/ | ||
|
||
#ifndef ADIOS2_BINDINGS_CXX11_CXX11_ATTRIBUTE_TCC_ | ||
#define ADIOS2_BINDINGS_CXX11_CXX11_ATTRIBUTE_TCC_ | ||
|
||
#include "Attribute.h" | ||
|
||
#include "adios2/helper/adiosFunctions.h" | ||
|
||
namespace adios2 | ||
{ | ||
|
||
template <class T> | ||
Attribute<T>::Attribute(core::Attribute<IOType> *attribute) | ||
: m_Attribute(attribute) | ||
{ | ||
} | ||
|
||
template <class T> | ||
Attribute<T>::operator bool() const noexcept | ||
{ | ||
return (m_Attribute == nullptr) ? false : true; | ||
} | ||
|
||
template <class T> | ||
std::string Attribute<T>::Name() const | ||
{ | ||
helper::CheckForNullptr(m_Attribute, "in call to Attribute<T>::Name()"); | ||
return m_Attribute->m_Name; | ||
} | ||
|
||
template <class T> | ||
std::string Attribute<T>::Type() const | ||
{ | ||
helper::CheckForNullptr(m_Attribute, "in call to Attribute<T>::Type()"); | ||
return m_Attribute->m_Type; | ||
} | ||
|
||
template <class T> | ||
std::vector<T> Attribute<T>::Data() const | ||
{ | ||
helper::CheckForNullptr(m_Attribute, "in call to Attribute<T>::Data()"); | ||
|
||
if (m_Attribute->m_IsSingleValue) | ||
{ | ||
return std::vector<T>{m_Attribute->m_DataSingleValue}; | ||
} | ||
else | ||
{ | ||
return reinterpret_cast<std::vector<T> &>(m_Attribute->m_DataArray); | ||
} | ||
} | ||
|
||
} // end namespace adios2 | ||
|
||
#endif /* ADIOS2_BINDINGS_CXX11_CXX11_ATTRIBUTE_TCC_ */ |
Oops, something went wrong.