DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System::Object Class Reference

Supports all classes in the DotNetDupe class hierarchy. More...

#include <Object.h>

Inheritance diagram for DotNetDupe::System::Object:

Public Member Functions

virtual ~Object ()=default
 Virtual destructor ensuring polymorphic cleanup.
virtual bool Equals (const Object &obj) const
 Determines whether the specified Object is equal to the current Object.
virtual int GetHashCode () const
 Serves as the default hash function.
bool operator== (const Object &obj) const
 Determines reference equality between two objects.
char * ToStringA () const
 Returns narrow-character string representation.
wchar_t * ToStringW () const
 Returns wide-character string representation.

Static Public Member Functions

static bool Equals (const Object &obj1, const Object &obj2)
 Static helper determining whether two object instances are equal.

Detailed Description

Supports all classes in the DotNetDupe class hierarchy.

Provides low-level identity, reference equality, hash code generation, and string representation services for derived types in the library. Thread-safe for const operations; derived classes must document their concurrency guarantees.

Note
Conforms to ECMA-335 Partition I Section 8.9.1 (System.Object).
See also
String, SmartPointer

Definition at line 18 of file Object.h.

Constructor & Destructor Documentation

◆ ~Object()

virtual DotNetDupe::System::Object::~Object ( )
virtualdefault

Virtual destructor ensuring polymorphic cleanup.

References DOTNETDUPE_API, Equals(), GetHashCode(), ToStringA(), and ToStringW().

Member Function Documentation

◆ Equals() [1/2]

bool DotNetDupe::System::Object::Equals ( const Object & obj) const
virtual

Determines whether the specified Object is equal to the current Object.

Parameters
objObject to compare with current instance.
Returns
True if equal; otherwise, false.

Virtual equality delegates to operator== by default for derived overrides.

Definition at line 11 of file Object.cpp.

Referenced by ~Object(), and DotNetDupe::System::Diagnostics::EtwLogReader::GetEventChannels().

◆ Equals() [2/2]

bool DotNetDupe::System::Object::Equals ( const Object & obj1,
const Object & obj2 )
static

Static helper determining whether two object instances are equal.

Parameters
obj1First object to compare.
obj2Second object to compare.
Returns
True if equal; otherwise, false.

Delegate to equality operator between instances.

Definition at line 16 of file Object.cpp.

◆ GetHashCode()

int DotNetDupe::System::Object::GetHashCode ( ) const
virtual

Serves as the default hash function.

Returns
An integer hash code for the current object.

Return default zero base; specialized derived classes override with custom hash algorithms.

Definition at line 21 of file Object.cpp.

Referenced by ~Object().

◆ operator==()

bool DotNetDupe::System::Object::operator== ( const Object & obj) const

Determines reference equality between two objects.

Parameters
objObject to compare with current instance.
Returns
True if objects share identity; otherwise, false.

Compare underlying memory addresses to determine pointer-level identity.

Definition at line 6 of file Object.cpp.

◆ ToStringA()

char * DotNetDupe::System::Object::ToStringA ( ) const

Returns narrow-character string representation.

Returns
Pointer to string representation or nullptr.

Base object returns null narrow-character representation.

Definition at line 31 of file Object.cpp.

Referenced by ~Object().

◆ ToStringW()

wchar_t * DotNetDupe::System::Object::ToStringW ( ) const

Returns wide-character string representation.

Returns
Pointer to string representation or nullptr.

Base object returns null wide-character representation.

Definition at line 26 of file Object.cpp.

Referenced by ~Object().


The documentation for this class was generated from the following files: