Skip to content
Permalink
Browse files
GEODE-5730: Fixes google-explicit-constructor clang-tidy warning (#350)
  • Loading branch information
pivotal-jbarrett committed Sep 12, 2018
1 parent fe5bec1 commit 1c2646db07a4e4b7c990c212f51b493d00fc585d
Showing 133 changed files with 297 additions and 278 deletions.
@@ -77,20 +77,10 @@ IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: "^\
BEGIN_TEST|\
DUNIT_TASK|\
DUNIT_TASK_DEFINITION|\
DUNIT_MAIN$"
MacroBlockEnd: "^\
END_TEST|\
ENDTASK|\
END_TASK|\
END_TASK_DEFINITION|\
END_MAIN$"
MacroBlockBegin: '^BEGIN_TEST|DUNIT_TASK|DUNIT_TASK_DEFINITION|DUNIT_MAIN$'
MacroBlockEnd: '^END_TEST|ENDTASK|END_TASK|END_TASK_DEFINITION|END_MAIN$'
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
@@ -103,13 +93,8 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
CanonicalDelimiter: ''
- Delimiter: pb
Language: TextProto
BasedOnStyle: google
ReflowComments: true
#SortIncludes: true
@@ -118,10 +103,7 @@ SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
@@ -1,7 +1,7 @@
---
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,-google-readability-todo,-google-runtime-references'
WarningsAsErrors: 'google-build-using-namespace,google-readability-redundant-smartptr-get'
HeaderFilterRegex: '\.(h|hpp)$'
WarningsAsErrors: 'google-build-using-namespace,google-readability-redundant-smartptr-get,google-explicit-constructor'
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: file
CheckOptions:
@@ -65,7 +65,7 @@ class APACHE_GEODE_EXPORT AttributesMutator {
public:
/** Internal constructor. Use Region::getAttributesMutator() to acquire the
* mutator for a region. */
AttributesMutator(const std::shared_ptr<Region>& region);
explicit AttributesMutator(const std::shared_ptr<Region>& region);

virtual ~AttributesMutator();

@@ -49,7 +49,7 @@ class APACHE_GEODE_EXPORT CacheableKeyType : public DataSerializablePrimitive,
inline CacheableKeyType()
: m_value(apache::geode::client::serializer::zeroObject<TObj>()) {}

inline CacheableKeyType(const TObj value) : m_value(value) {}
inline explicit CacheableKeyType(const TObj value) : m_value(value) {}

public:
/** Gets the contained value. */
@@ -134,8 +134,7 @@ class APACHE_GEODE_EXPORT CacheableContainerType
public TBase {
protected:
inline CacheableContainerType() : TBase() {}

inline CacheableContainerType(const int32_t n) : TBase(n) {}
inline explicit CacheableContainerType(const int32_t n) : TBase(n) {}

public:
// Cacheable methods
@@ -170,7 +169,7 @@ class APACHE_GEODE_EXPORT CacheableContainerType
class APACHE_GEODE_EXPORT k : public _##k { \
public: \
inline k() : _##k() {} \
inline k(const p value) : _##k(value) {} \
inline explicit k(const p value) : _##k(value) {} \
\
/** Factory function registered with serialization registry. */ \
static std::shared_ptr<Serializable> createDeserializable() { \
@@ -203,7 +202,7 @@ class APACHE_GEODE_EXPORT CacheableContainerType
class APACHE_GEODE_EXPORT c : public _##c { \
public: \
inline c() : _##c() {} \
inline c(const int32_t n) : _##c(n) {} \
inline explicit c(const int32_t n) : _##c(n) {} \
\
/** Factory function registered with serialization registry. */ \
static std::shared_ptr<Serializable> createDeserializable() { \
@@ -296,7 +295,8 @@ class APACHE_GEODE_EXPORT CacheableArray : public DataSerializablePrimitive {
inline CacheableArray() = default;

template <typename TT>
CacheableArray(TT&& value) : m_value(std::forward<TT>(value)) {}
inline explicit CacheableArray(TT&& value)
: m_value(std::forward<TT>(value)) {}

~CacheableArray() noexcept override = default;

@@ -56,17 +56,17 @@ class APACHE_GEODE_EXPORT CacheableDate
typedef std::chrono::milliseconds duration;

/** Constructor, used for deserialization. */
CacheableDate(const time_t value = 0);
explicit CacheableDate(const time_t value = 0);

/**
* Construct from std::chrono::time_point<std::chrono::system_clock>.
*/
CacheableDate(const time_point& value);
explicit CacheableDate(const time_point& value);

/**
* Construct from std::chrono::seconds since POSIX epoch.
*/
CacheableDate(const duration& value);
explicit CacheableDate(const duration& value);

~CacheableDate() noexcept override = default;

@@ -101,11 +101,11 @@ class APACHE_GEODE_EXPORT CacheableDate
* @return the hashcode for this object. */
virtual int32_t hashcode() const override;

operator time_t() const { return m_timevalue / 1000; }
operator time_point() const {
explicit operator time_t() const { return m_timevalue / 1000; }
explicit operator time_point() const {
return clock::from_time_t(0) + duration(m_timevalue);
}
operator duration() const { return duration(m_timevalue); }
explicit operator duration() const { return duration(m_timevalue); }

/**
* Factory method for creating an instance of CacheableDate
@@ -46,8 +46,9 @@ class Serializable;
class APACHE_GEODE_EXPORT CacheableFileName : public CacheableString {
public:
inline CacheableFileName() = default;
inline CacheableFileName(const std::string& value) : CacheableString(value) {}
inline CacheableFileName(std::string&& value)
inline explicit CacheableFileName(const std::string& value)
: CacheableString(value) {}
inline explicit CacheableFileName(std::string&& value)
: CacheableString(std::move(value)) {}
~CacheableFileName() noexcept override = default;
void operator=(const CacheableFileName& other) = delete;
@@ -51,7 +51,7 @@ class APACHE_GEODE_EXPORT CacheableObjectArray
inline CacheableObjectArray() : std::vector<std::shared_ptr<Cacheable>>() {}

/** Create a vector with n elements allocated. */
inline CacheableObjectArray(int32_t n)
inline explicit CacheableObjectArray(int32_t n)
: std::vector<std::shared_ptr<Cacheable>>(n) {}

~CacheableObjectArray() noexcept override = default;
@@ -47,13 +47,13 @@ class APACHE_GEODE_EXPORT CacheableString
mutable int m_hashcode;

public:
inline CacheableString(DSCode type = DSCode::CacheableASCIIString)
inline explicit CacheableString(DSCode type = DSCode::CacheableASCIIString)
: m_str(), m_type(type), m_hashcode(0) {}

inline CacheableString(const std::string& value)
inline explicit CacheableString(const std::string& value)
: CacheableString(std::string(value)) {}

inline CacheableString(std::string&& value)
inline explicit CacheableString(std::string&& value)
: m_str(std::move(value)), m_hashcode(0) {
bool ascii = isAscii(m_str);

@@ -74,7 +74,8 @@ class APACHE_GEODE_EXPORT CqAttributesFactory {
* the <code>CqAttributes</code> used to initialize this
* AttributesFactory
*/
CqAttributesFactory(const std::shared_ptr<CqAttributes>& cqAttributes);
explicit CqAttributesFactory(
const std::shared_ptr<CqAttributes>& cqAttributes);

/**
* Adds a CQ listener to the end of the list of cq listeners on this factory.
@@ -45,7 +45,7 @@ class APACHE_GEODE_EXPORT CqAttributesMutator {
/** Constructs a <code>CqAttributesMutator</code> with the given {@link
* CqAttributes}.
*/
CqAttributesMutator(const std::shared_ptr<CqAttributes>& impl);
explicit CqAttributesMutator(const std::shared_ptr<CqAttributes>& impl);

/**
* Adds a CQ listener to the end of the list of CQ listeners on this CqQuery.
@@ -43,8 +43,8 @@ class StackTrace;
class APACHE_GEODE_EXPORT Exception : public std::exception {
public:
explicit Exception(const std::string& message);
Exception(std::string&& message);
Exception(const char* message);
explicit Exception(std::string&& message);
explicit Exception(const char* message);
Exception(const Exception&) = default;
Exception& operator=(const Exception&) = default;
Exception(Exception&&) noexcept = default;
@@ -119,7 +119,7 @@ class APACHE_GEODE_EXPORT Execution {
private:
std::unique_ptr<ExecutionImpl> impl_;

Execution(std::unique_ptr<ExecutionImpl> impl);
explicit Execution(std::unique_ptr<ExecutionImpl> impl);

friend ExecutionImpl;
friend FunctionService;
@@ -69,7 +69,7 @@ class APACHE_GEODE_EXPORT ExpirationAttributes {
* @param expirationAction the action to take when the value expires
* @throws IllegalArgumentException if expirationTime is nonpositive
*/
ExpirationAttributes(
explicit ExpirationAttributes(
const std::chrono::seconds& expirationTime,
const ExpirationAction expirationAction = ExpirationAction::INVALIDATE);

@@ -126,7 +126,7 @@ class APACHE_GEODE_EXPORT PersistenceManager {
*/
virtual void close() = 0;

PersistenceManager(const std::shared_ptr<Region>& regionPtr)
explicit PersistenceManager(const std::shared_ptr<Region>& regionPtr)
: m_regionPtr(regionPtr) {}

PersistenceManager() = default;
@@ -284,7 +284,7 @@ class APACHE_GEODE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
int getPendingEventCount() const;

protected:
Pool(std::shared_ptr<PoolAttributes> attr);
explicit Pool(std::shared_ptr<PoolAttributes> attr);
std::shared_ptr<PoolAttributes> m_attrs;

private:
@@ -536,7 +536,7 @@ class APACHE_GEODE_EXPORT PoolFactory {
PoolFactory(const PoolFactory&) = default;

private:
PoolFactory(const Cache& cache);
explicit PoolFactory(const Cache& cache);
PoolFactory& addCheck(const std::string& host, int port);
std::shared_ptr<PoolAttributes> m_attrs;
bool m_isSubscriptionRedundancy;
@@ -116,7 +116,7 @@ class APACHE_GEODE_EXPORT PoolManager {

std::shared_ptr<PoolManagerImpl> m_pimpl;

PoolManager(CacheImpl* cache);
explicit PoolManager(CacheImpl* cache);

friend Cache;
friend CacheImpl;
@@ -1478,7 +1478,7 @@ class APACHE_GEODE_EXPORT Region : public std::enable_shared_from_this<Region> {
Region& operator=(const Region&) = delete;

protected:
Region(CacheImpl* cacheImpl);
explicit Region(CacheImpl* cacheImpl);
virtual ~Region();

CacheImpl* m_cacheImpl;
@@ -175,7 +175,7 @@ class APACHE_GEODE_EXPORT RegionAttributesFactory {
* @param regionAttributes the <code>RegionAttributes</code> used to
* initialize this RegionAttributesFactory
*/
RegionAttributesFactory(const RegionAttributes regionAttributes);
explicit RegionAttributesFactory(const RegionAttributes regionAttributes);

RegionAttributesFactory(const RegionAttributesFactory&) = default;

@@ -51,8 +51,8 @@ class APACHE_GEODE_EXPORT SystemProperties {
* If useMemType is true, use the given member type; if false, always set
* member type to SERVER.
*/
SystemProperties(const std::shared_ptr<Properties>& propertiesPtr,
const std::string& configFile = "");
explicit SystemProperties(const std::shared_ptr<Properties>& propertiesPtr,
const std::string& configFile = "");

SystemProperties(const SystemProperties& rhs) = delete;
void operator=(const SystemProperties& rhs) = delete;
@@ -34,7 +34,7 @@ class PdxSerializer;

class APACHE_GEODE_EXPORT TypeRegistry {
public:
TypeRegistry(CacheImpl* cache);
explicit TypeRegistry(CacheImpl* cache);

/**
* @brief register an instance factory method for a given type.
@@ -40,7 +40,7 @@ class SerializableWithThreadId : public PdxSerializable {
public:
SerializableWithThreadId() : SerializableWithThreadId(0) {}

SerializableWithThreadId(uint32_t id) : id_(id) {}
explicit SerializableWithThreadId(uint32_t id) : id_(id) {}

~SerializableWithThreadId() noexcept override = default;

0 comments on commit 1c2646d

Please sign in to comment.