Base class that enables using methods available for System.Object class in C#. All non-trivial classes used with translated environment should inherit it. More...

#include "object.h"

Inherited by Aspose::Page::XPS::Features::EventBasedModifications::IBeforeSavingEventHandler< System::SharedPtr< Aspose::Page::XPS::Features::EventBasedModifications::PageAPI > > [virtual], System::Collections::Generic::BaseSet< T, std::unordered_set< T, EqualityComparerHashAdapter< T >, EqualityComparerAdapter< T >, System::Details::CollectionHelpers::ContainerPointerMode< T >::allocator_type > > [virtual], System::Collections::Generic::BaseSet< T, std::set< T, ComparerAdapter< T >, System::Details::CollectionHelpers::ContainerPointerMode< T >::allocator_type > > [virtual], System::Collections::Generic::IComparer< System::SharedPtr< System::Net::Cookie > > [virtual], System::Collections::Generic::IComparer< System::String > [virtual], System::Collections::Generic::IComparer< String > [virtual], System::Collections::Generic::IEnumerable< bool > [virtual], System::Collections::Generic::IEnumerable< KeyValuePair< System::String, System::SharedPtr< Aspose::Page::EPS::XMP::XmpValue > > > [virtual], System::Collections::Generic::IEnumerable< System::String > [virtual], System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Page::XPS::XpsModel::XpsContentElement > > [virtual], System::Collections::Generic::IEnumerable< System::SharedPtr< ZipEntry > > [virtual], System::Collections::Generic::IEnumerable< KeyValuePair< Map::key_type, Map::mapped_type > > [virtual], System::Collections::Generic::IEnumerable< KV > [virtual], System::Collections::Generic::IEnumerable< Result > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< System::Linq::IGrouping< Key, Source > > > [virtual], System::Collections::Generic::IEnumerable< Source > [virtual], System::Collections::Generic::IEnumerable< KeyValuePair< TKey, TValue > > [virtual], System::Collections::Generic::IEnumerable< Dict::map_t::key_type > [virtual], System::Collections::Generic::IEnumerable< Dict::map_t::mapped_type > [virtual], System::Collections::Generic::IEnumerable< TItem > [virtual], System::Collections::Generic::IEnumerable< KeyValuePair< std::unordered_map< String, String, EqualityComparerHashAdapter< String >, EqualityComparerAdapter< String >, ASPOSE_MAP_ALLOCATOR_TYPE(String, String)>::key_type, std::unordered_map< String, String, EqualityComparerHashAdapter< String >, EqualityComparerAdapter< String >, ASPOSE_MAP_ALLOCATOR_TYPE(String, String)>::mapped_type > > [virtual], System::Collections::Generic::IEnumerable< System::SharedPtr< System::Net::Cookie > > [virtual], System::Collections::Generic::IEnumerable< System::Collections::Generic::KeyValuePair< System::String, System::SharedPtr< System::Collections::Generic::IEnumerable< System::String > > > > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< X509Certificate2 > > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< X509Certificate > > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< X509Extension > > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< Xml::KeyInfoClause > > [virtual], System::Collections::Generic::IEnumerable< CapturePtr > [virtual], System::Collections::Generic::IEnumerable< GroupPtr > [virtual], System::Collections::Generic::IEnumerable< MatchPtr > [virtual], System::Collections::Generic::IEnumerable< System::SharedPtr< SoapHeader > > [virtual], System::Collections::Generic::IEnumerable< System::SharedPtr< Control > > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< System::Xml::Schema::XmlSchema > > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< System::Xml::Schema::XmlSchemaObject > > [virtual], System::Collections::Generic::IEnumerable< System::Collections::Generic::KeyValuePair< SharedPtr< System::Xml::XmlQualifiedName >, SharedPtr< System::Xml::Schema::XmlSchemaObject > > > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< System::Xml::XPath::XPathNavigator > > [virtual], System::Collections::Generic::IEnumerable< SharedPtr< System::Xml::XmlNode > > [virtual], System::Collections::Generic::IEnumerable< String > [virtual], System::Collections::Generic::IEqualityComparer< String > [virtual], System::Collections::Generic::List< SharedPtr< X509Certificate2 > > [virtual], System::Collections::Generic::List< SharedPtr< X509Certificate > > [virtual], System::Collections::Generic::List< SharedPtr< X509Extension > > [virtual], System::Collections::Generic::List< CapturePtr > [virtual], System::Collections::Generic::List< GroupPtr > [virtual], System::Collections::Generic::List< MatchPtr > [virtual], System::Collections::Generic::List< System::SharedPtr< SoapHeader > > [virtual], System::IEquatable< SharedPtr< SortVersion > > [virtual], System::IEquatable< System::SharedPtr< System::Net::Http::HttpMethod > > [virtual], System::IEquatable< SharedPtr< RSAEncryptionPadding > > [virtual], System::IEquatable< SharedPtr< RSASignaturePadding > > [virtual], System::IEquatable< TimeZoneInfoPtr > [virtual], System::IEquatable< AdjustmentRulePtr > [virtual], Aspose::Page::AssemblyConstants, Aspose::Page::BuildVersionInfo, Aspose::Page::Document [virtual], Aspose::Page::Drawing::Color, Aspose::Page::Drawing::Drawing2D::NamespaceDoc, Aspose::Page::Drawing::Imaging::NamespaceDoc, Aspose::Page::Drawing::NamespaceDoc, Aspose::Page::Drawing::Size, Aspose::Page::EPS::BinaryHeader, Aspose::Page::EPS::Device::PdfNode, Aspose::Page::EPS::FontConstants, Aspose::Page::EPS::LoadOptions, Aspose::Page::EPS::MiscUtil, Aspose::Page::EPS::NamespaceDoc, Aspose::Page::EPS::PageConstants, Aspose::Page::EPS::XMP::NamespaceDoc, Aspose::Page::EPS::XMP::XmpField, Aspose::Page::EPS::XMP::XmpValue, Aspose::Page::ExternalFontCache, Aspose::Page::Font::DrFont, Aspose::Page::Font::NamespaceDoc, Aspose::Page::IGlyph [virtual], Aspose::Page::IInteractiveDevice [virtual], Aspose::Page::IMultiPageDevice [virtual], Aspose::Page::IMultiPageSaveOptions [virtual], Aspose::Page::IStreamable [virtual], Aspose::Page::License, Aspose::Page::Margins, Aspose::Page::Metered, Aspose::Page::NamespaceDoc, Aspose::Page::Plugins::IDataContainer [virtual], Aspose::Page::Plugins::IDataSource [virtual], Aspose::Page::Plugins::IOperationResult [virtual], Aspose::Page::Plugins::IPlugin [virtual], Aspose::Page::Plugins::IPluginOptions [virtual], Aspose::Page::Plugins::ISaveInstruction [virtual], Aspose::Page::Plugins::ResultContainer, Aspose::Page::SaveOptions [virtual], Aspose::Page::XPS::DocumentUtils, Aspose::Page::XPS::Features::EventBasedModifications::BeforeSavingEventArgs< typename >, Aspose::Page::XPS::Features::EventBasedModifications::IBeforeSavingEventHandler< T > [virtual], Aspose::Page::XPS::Features::EventBasedModifications::IModificationAPI [virtual], Aspose::Page::XPS::Features::NamespaceDoc, Aspose::Page::XPS::LoadOptions, Aspose::Page::XPS::NamespaceDoc, Aspose::Page::XPS::Presentation::IEventBasedModificationOptions [virtual], Aspose::Page::XPS::Presentation::IPipelineOptions [virtual], Aspose::Page::XPS::Presentation::IXpsTextConversionOptions [virtual], Aspose::Page::XPS::Presentation::Pdf::PdfDigitalSignatureDetails, Aspose::Page::XPS::Presentation::Pdf::PdfEncryptionDetails, Aspose::Page::XPS::Presentation::Xps::TiffDataReader, Aspose::Page::XPS::XpsDocumentVisitor [virtual], Aspose::Page::XPS::XpsMetadata::IPrintTicketElementChild [virtual], Aspose::Page::XPS::XpsMetadata::JobOptimalDestinationColorProfile::Profile, Aspose::Page::XPS::XpsMetadata::NamespaceDoc, Aspose::Page::XPS::XpsModel::ITransformableProperty [virtual], Aspose::Page::XPS::XpsModel::NamespaceDoc, Aspose::Page::XPS::XpsModel::XpsColor, Aspose::Page::XPS::XpsModel::XpsContext, Aspose::Page::XPS::XpsModel::XpsFileResource, Aspose::Page::XPS::XpsModel::XpsGlyphMapping, Aspose::Page::XPS::XpsModel::XpsGlyphsClusterMap, Aspose::Page::XPS::XpsModel::XpsHyperlinkTarget, Aspose::Page::XPS::XpsModel::XpsObject [virtual], Aspose::Page::XPS::XpsPackageParts::FixedPart, Aspose::Page::XPS::XpsUtils, Aspose::Zip::CRC32, Aspose::Zip::ZipEntry, Aspose::Zip::ZlibCodec, , , , , , , System::Array< T > [virtual], System::Array< T >::Enumerator [virtual], System::ArraySegment< T >, System::Attribute, System::BoxedValueBase, System::Collections::BitArray [virtual], System::Collections::BitArray::Enumerator [virtual], System::Collections::CollectionBase< T >::ListImpl, System::Collections::Generic::BaseSet< T, SET_T > [virtual], System::Collections::Generic::IComparer< T > [virtual], System::Collections::Generic::IEnumerable< T > [virtual], System::Collections::Generic::IEqualityComparer< T > [virtual], System::Collections::Generic::LinkedList< T > [virtual], System::Collections::Generic::LinkedList< T >::Enumerator [virtual], System::Collections::Generic::LinkedListNode< T >, System::Collections::Generic::List< T > [virtual], System::Collections::IEnumerable [virtual], System::Collections::IEnumerator [virtual], System::Collections::ObjectModel::ReadOnlyCollection< T > [virtual], System::ComponentModel::Container, System::ComponentModel::Design::Serialization::InstanceDescriptor, System::ComponentModel::IComponent [virtual], System::ComponentModel::IContainer [virtual], System::ComponentModel::ITypeDescriptorContext [virtual], System::ComponentModel::TypeConverter, System::ComponentModel::TypeDescriptor, System::DBNull, System::Data::Common::DbCommand, System::Data::Common::DbConnection, System::Data::Common::DbConnectionStringBuilder, System::Data::Common::DbDataReader, System::Data::Common::DbProviderFactory, System::Data::DataColumn, System::Data::DataColumnCollection, System::Data::DataRelation, System::Data::DataRelationCollection, System::Data::DataRow, System::Data::DataRowCollection, System::Data::DataRowView, System::Data::DataSet, System::Data::DataTable, System::Data::DataTableCollection, System::Data::DataView, System::Data::IDataRecord [virtual], System::DefaultBoxedValue< T >, , , System::Diagnostics::PerformanceCounter, System::Diagnostics::Process, System::Diagnostics::ProcessStartInfo, System::Diagnostics::StackFrame, System::Diagnostics::StackTrace, System::Diagnostics::Stopwatch, System::Diagnostics::TraceListener, System::Drawing::Brush, System::Drawing::Drawing2D::Blend, System::Drawing::Drawing2D::ColorBlend, System::Drawing::Drawing2D::CustomLineCap, System::Drawing::Drawing2D::GraphicsPath, System::Drawing::Drawing2D::Matrix, System::Drawing::Drawing2D::PathData, System::Drawing::Drawing2D::RegionData, System::Drawing::Font, System::Drawing::FontFamily, System::Drawing::Graphics [virtual], System::Drawing::Icon, System::Drawing::Imaging::BitmapData, System::Drawing::Imaging::ColorMap, System::Drawing::Imaging::ColorMatrix, System::Drawing::Imaging::ColorPalette, System::Drawing::Imaging::Encoder, System::Drawing::Imaging::EncoderParameter, System::Drawing::Imaging::EncoderParameters, System::Drawing::Imaging::FrameDimension, System::Drawing::Imaging::ImageAttributes, System::Drawing::Imaging::ImageCodecInfo, System::Drawing::Imaging::ImageFormat, System::Drawing::Imaging::MetafileHeader, System::Drawing::Imaging::PropertyItem, System::Drawing::Pen, System::Drawing::Printing::Margins, System::Drawing::Printing::PageSettings, System::Drawing::Printing::PaperSize, System::Drawing::Printing::PrintController, System::Drawing::Printing::PrintDocument, System::Drawing::Printing::PrinterResolution, System::Drawing::Printing::PrinterSettings, System::Drawing::Region, System::Drawing::StringFormat, System::Drawing::SystemFonts, System::EventArgs, System::GC, System::Globalization::CompareInfo [virtual], System::Globalization::CultureInfo [virtual], System::Globalization::DateTimeFormatInfo [virtual], System::Globalization::DaylightTime [virtual], System::Globalization::IdnMapping, System::Globalization::NumberFormatInfo [virtual], System::Globalization::RegionInfo [virtual], System::Globalization::SortKey, System::Globalization::StringInfo [virtual], System::Globalization::TextElementEnumerator [virtual], System::IAsyncResult [virtual], System::ICloneable [virtual], System::IComparable< T > [virtual], System::IConvertible [virtual], System::ICustomFormatter [virtual], System::IDisposable [virtual], System::IEquatable< T > [virtual], System::IFormatProvider [virtual], System::IFormattable [virtual], System::IO::FileSystemInfo, System::MarshalByRefObject [virtual], System::Net::Cache::RequestCachePolicy, System::Net::Cookie, System::Net::CookieContainer, System::Net::CookieParser, System::Net::Dns, System::Net::EndPoint, System::Net::HeaderVariantInfo, System::Net::Http::HttpUtilities, System::Net::HttpResponseHeaderExtensions, System::Net::HttpStatusDescription, System::Net::ICredentials [virtual], System::Net::ICredentialsByHost [virtual], System::Net::IPAddress, System::Net::IPHostEntry, System::Net::IWebProxy [virtual], System::Net::IWebRequestCreate, System::Net::NetworkCredential [virtual], System::Net::NetworkInformation::HostInformation, System::Net::NetworkInformation::IPGlobalProperties, System::Net::PathList, System::Net::ServicePoint, System::Net::ServicePointManager, System::Net::SocketAddress, System::Net::Sockets::IPPacketInformation, System::Net::Sockets::LingerOption, System::Net::Sockets::TcpListener, System::Net::UriScheme, System::Net::WebHeaderCollection, System::Net::WebRequest [virtual], System::Net::WebRequest::WebRequestPrefixElement, System::Random, System::Reflection::Assembly, System::Reflection::AssemblyName, System::Reflection::MemberInfo, System::Resources::ResourceManager, System::Runtime::CompilerServices::ITuple [virtual], System::Runtime::Serialization::IFormatterConverter, System::Runtime::Serialization::ISerializable [virtual], System::Runtime::Serialization::SerializationInfo, System::Security::Cryptography::AsnEncodedData, System::Security::Cryptography::AsymmetricAlgorithm [virtual], System::Security::Cryptography::AsymmetricSignatureDeformatter, System::Security::Cryptography::AsymmetricSignatureFormatter, System::Security::Cryptography::CspKeyContainerInfo [virtual], System::Security::Cryptography::CspParameters, System::Security::Cryptography::DSAParameters, System::Security::Cryptography::DeriveBytes, System::Security::Cryptography::ICryptoTransform [virtual], System::Security::Cryptography::ICspAsymmetricAlgorithm [virtual], System::Security::Cryptography::KeySizes, System::Security::Cryptography::Oid, System::Security::Cryptography::Pkcs::CmsSigner, System::Security::Cryptography::Pkcs::ContentInfo, System::Security::Cryptography::Pkcs::SignedCms, System::Security::Cryptography::RSAParameters, System::Security::Cryptography::RandomNumberGenerator [virtual], System::Security::Cryptography::SymmetricAlgorithm [virtual], System::Security::Cryptography::X509Certificates::PublicKey, System::Security::Cryptography::X509Certificates::X509Certificate [virtual], System::Security::Cryptography::X509Certificates::X509Chain, System::Security::Cryptography::X509Certificates::X509ChainPolicy, System::Security::Cryptography::X509Certificates::X509ChainStatus, System::Security::Cryptography::Xml::DataObject, System::Security::Cryptography::Xml::KeyInfoClause, System::Security::Cryptography::Xml::Reference, System::Security::Cryptography::Xml::SignedInfo, System::Security::Cryptography::Xml::SignedXml, System::Security::Cryptography::Xml::Transform, System::Security::Cryptography::Xml::TransformChain, System::Security::Cryptography::Xml::X509IssuerSerial, System::Security::Permissions::SecurityPermission, System::Security::Policy::Evidence, System::Security::SecurityElement, System::StringComparer [virtual], System::Text::Decoder, System::Text::DecoderFallback, System::Text::DecoderFallbackBuffer, System::Text::Encoder, System::Text::EncoderFallback, System::Text::EncoderFallbackBuffer, System::Text::Encoding, System::Text::EncodingInfo, System::Text::RegularExpressions::Capture, System::Text::RegularExpressions::Regex, System::Text::StringBuilder, System::Threading::Monitor, System::Threading::Thread, System::Threading::ThreadPool, System::Threading::Timer, System::Threading::WaitHandle, System::TimeZone, System::Uri, System::UriBuilder, System::WeakReference< T >, System::Web::HttpContext, System::Web::HttpResponse, System::Web::HttpUtility, System::Web::Services::Protocols::SoapHeader, System::Web::Services::Protocols::SoapMessage, System::Web::Services::Protocols::WebClientProtocol [virtual], System::Web::UI::WebControls::DataGrid, System::Windows::Forms::Control, System::Windows::Forms::IButtonControl [virtual], System::Windows::Forms::Screen, System::Xml::IApplicationResourceStreamResolver, System::Xml::IHasXmlNode [virtual], System::Xml::IXmlLineInfo [virtual], System::Xml::IXmlNamespaceResolver [virtual], System::Xml::Schema::IXmlSchemaInfo [virtual], System::Xml::Schema::XmlSchemaCompilationSettings, System::Xml::Schema::XmlSchemaDatatype, System::Xml::Schema::XmlSchemaInference, System::Xml::Schema::XmlSchemaObject, System::Xml::Schema::XmlSchemaSet, System::Xml::Schema::XmlSchemaValidator, System::Xml::Serialization::IXmlSerializable [virtual], System::Xml::Serialization::XmlAttributeOverrides, System::Xml::Serialization::XmlRootAttribute, System::Xml::Serialization::XmlSerializationReader, System::Xml::Serialization::XmlSerializationWriter, System::Xml::Serialization::XmlSerializer, System::Xml::Serialization::XmlSerializerImplementation, System::Xml::Serialization::XmlSerializerNamespaces, System::Xml::XPath::IXPathNavigable [virtual], System::Xml::XPath::XPathExpression, System::Xml::XPath::XPathItem [virtual], System::Xml::XmlCharType, System::Xml::XmlConvert, System::Xml::XmlImplementation, System::Xml::XmlNameTable, System::Xml::XmlParserContext, System::Xml::XmlQualifiedName, System::Xml::XmlReaderSettings, and System::Xml::XmlResolver.

Public Types

typedef SmartPtr< Objectptr
 Alias for smart pointer type.
 

Public Member Functions

 Object ()
 Creates object. Initializes all internal data structures.
 
virtual ~Object ()
 Destroys object. Frees all internal data structures.
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses.
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses.
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector.
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector.
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value.
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector.
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector.
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object.
 
int SharedCount () const
 Gets current value of shared reference counter.
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object.
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics.
 
virtual int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
 
virtual String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string.
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types.
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call.
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator.
 
virtual void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
 
virtual bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only.
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr.
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings.
 

Static Public Member Functions

static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference.
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference.
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr.
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style.
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style.
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct.
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
 

Detailed Description

Base class that enables using methods available for System.Object class in C#. All non-trivial classes used with translated environment should inherit it.

Alongside with methods available in C# System.Object class, it also enables support for some concepts specific for translated code environment. This includes reference counting used by smart pointer classes (System::SmartPtr, System::WeakPtr, System::DynamicWeakPtr) and other services related to memory management, debug, etc.

Each Object has two reference counters: shared reference counter and weak reference counter. Weak reference counter is always stored in detached data structure rather than in Object itself which allows weak pointers overlive referenced object. Smart reference counter is stored either in object itself or in same detached structure, depending on ENABLE_EXTERNAL_REFCOUNT macro state. By default, it is enabled in debug builds and disabled in release builds. If smart pointer counter is stored in object itself, detached data structure is created only if weak pointers to object exist. Otherwise, it is created alongside with object itself.

All smart pointers use these two reference counters and contribute to same and only ownership group.

If Object subclass is created on stack, no smart pointers to it may be created, otherwise there is a stack deletion issue.

This type can be allocated either in stack as value type or in heap using System::MakeObject() function. Once the object is allocated, never mix up these two usecases: having SmartPtr pointers onto stack-allocated objects is strictly prohibited.

Member Typedef Documentation

◆ ptr

Alias for smart pointer type.

Constructor & Destructor Documentation

◆ Object() [1/2]

System::Object::Object ( )

Creates object. Initializes all internal data structures.

◆ ~Object()

virtual System::Object::~Object ( )
virtual

Destroys object. Frees all internal data structures.

◆ Object() [2/2]

System::Object::Object ( Object const & x)

Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses.

Parameters
xFormal parameter.

Member Function Documentation

◆ Equals() [1/5]

template<>
bool System::Object::Equals ( double const & objA,
double const & objB )
inlinestatic

Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.

Parameters
objALHS floating point value.
objBRHS floating point value.
Returns
True if objA and objB are both NaN or equal, false otherwise.

◆ Equals() [2/5]

template<>
bool System::Object::Equals ( float const & objA,
float const & objB )
inlinestatic

Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.

Parameters
objALHS floating point value.
objBRHS floating point value.
Returns
True if objA and objB are both NaN or equal, false otherwise.

◆ Equals() [3/5]

virtual bool System::Object::Equals ( ptr obj)
virtual

Compares objects using C# Object.Equals semantics.

Parameters
objObject to compare current one to.
Returns
True if objects are considered equal and false otherwise.

Reimplemented in System::BoxedValue< T >, System::DefaultBoxedValue< T >, and System::Drawing::Drawing2D::Matrix.

◆ Equals() [4/5]

template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type System::Object::Equals ( T1 const & objA,
T2 const & objB )
inlinestatic

Compares reference type objects in C# style.

Template Parameters
T1Type of first object to compare.
T2Type of second object to compare.
Parameters
objAFirst object to compare.
objBSecond object to compare.
Returns
True if objects match either by reference or semantically (by Object.Equals-alike comparison), false otherwise.

◆ Equals() [5/5]

template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type System::Object::Equals ( T1 const & objA,
T2 const & objB )
inlinestatic

Compares value type objects in C# style.

Template Parameters
T1Type of first object to compare.
T2Type of second object to compare.
Parameters
objAFirst object to compare.
objBSecond object to compare.
Returns
True if objects are considered equal by equality operator available, false otherwise.

◆ FastCast()

virtual bool System::Object::FastCast ( const Details::FastRttiBase & helper,
void ** out_ptr ) const
virtual

For internal purposes only.

Parameters
helperFastRttiBase structure specialized with a desired type.
out_ptrA pointer to a desired type if conversion is available.
Returns
True if a class supports FastRTTI operations.

◆ GetCounter()

Detail::SmartPtrCounter * System::Object::GetCounter ( )
inline

Gets reference counter data structure associated with the object.

Implementation.

Returns
Pointer to reference counting data structure associated with object.

◆ GetHashCode()

virtual int32_t System::Object::GetHashCode ( ) const
virtual

Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.

Returns
Hash code value as calculated by corresponding class.

Reimplemented in Aspose::Page::Drawing::Color, Aspose::Page::Drawing::Size, Aspose::Page::EPS::XMP::XmpField, Aspose::Page::Font::DrFont, Aspose::Page::Margins, Aspose::Page::XPS::XpsModel::XpsMatrix, System::ArraySegment< T >, System::BoxedValue< T >, System::DefaultBoxedValue< T >, System::Globalization::CompareInfo, System::Globalization::CultureInfo, System::Globalization::IdnMapping, System::Globalization::RegionInfo, System::Globalization::SortKey, System::Globalization::SortVersion, System::Globalization::StringInfo, System::Globalization::TextInfo, System::Net::Cookie, System::Net::DnsEndPoint, System::Net::Http::Headers::AuthenticationHeaderValue, System::Net::Http::Headers::CacheControlHeaderValue, System::Net::Http::Headers::ContentDispositionHeaderValue, System::Net::Http::Headers::ContentRangeHeaderValue, System::Net::Http::Headers::EntityTagHeaderValue, System::Net::Http::Headers::MediaTypeHeaderValue, System::Net::Http::Headers::NameValueHeaderValue, System::Net::Http::Headers::NameValueWithParametersHeaderValue, System::Net::Http::Headers::ProductHeaderValue, System::Net::Http::Headers::ProductInfoHeaderValue, System::Net::Http::Headers::RangeConditionHeaderValue, System::Net::Http::Headers::RangeHeaderValue, System::Net::Http::Headers::RangeItemHeaderValue, System::Net::Http::Headers::RetryConditionHeaderValue, System::Net::Http::Headers::StringWithQualityHeaderValue, System::Net::Http::Headers::TransferCodingHeaderValue, System::Net::Http::Headers::ViaHeaderValue, System::Net::Http::Headers::WarningHeaderValue, System::Net::Http::HttpMethod, System::Net::IPAddress, System::Net::IPEndPoint, System::Net::SocketAddress, System::Net::Sockets::IPPacketInformation, System::Security::Cryptography::RSAEncryptionPadding, System::Security::Cryptography::RSASignaturePadding, System::Security::Cryptography::X509Certificates::X509Certificate, System::Text::Encoding, System::Text::UnicodeEncoding, System::Text::UTF32Encoding, System::Text::UTF7Encoding, System::Text::UTF8Encoding, System::Threading::Thread, System::TimeZoneInfo::AdjustmentRule, System::TimeZoneInfo, System::Uri, and System::Xml::XmlQualifiedName.

◆ GetType()

virtual const TypeInfo & System::Object::GetType ( ) const
virtual

Gets actual type of object. Analog of C# System.Object.GetType() call.

Returns
TypeInfo object which describes final type.

Reimplemented in System::BoxedValue< T >, and System::DefaultBoxedValue< T >.

◆ Is()

virtual bool System::Object::Is ( const TypeInfo & targetType) const
virtual

Check if object represents an instance of type described by targetType. Analog of C# 'is' operator.

Parameters
targetTypeTypeInfo structure describing the type to test current object against.
Returns
True if object is of tagged type or its subclass, false otherwise.

◆ Lock()

void System::Object::Lock ( )

Implements C# lock() statement locking. Call directly or use LockContext sentry object.

◆ MemberwiseClone()

virtual ptr System::Object::MemberwiseClone ( ) const
virtual

Analog of C# Object.MemberwiseClone() method. Enables cloning custom types.

Returns
Pointer to object copy created.
Exceptions
NotImplementedexception is thrown by default. Implement manually or use polymorphic_memberwiseclone option to enable this method in translated code.

◆ operator=()

Object & System::Object::operator= ( Object const & x)
inline

Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses.

Parameters
xFormal parameter.

◆ ReferenceEquals() [1/5]

static bool System::Object::ReferenceEquals ( ptr const & objA,
ptr const & objB )
inlinestatic

Compares objects by reference.

Parameters
objAFirst pointer to compare.
objBSecond pointer to compare.
Returns
True if pointers match and false otherwise.

◆ ReferenceEquals() [2/5]

template<>
bool System::Object::ReferenceEquals ( String const & str,
std::nullptr_t  )
inline

Specialization of Object::ReferenceEquals for case of string and nullptr.

Parameters
strString to compare to nullptr.
Returns
true if string is null, false otherwise.

◆ ReferenceEquals() [3/5]

template<>
bool System::Object::ReferenceEquals ( String const & str1,
String const & str2 )
inline

Specialization of Object::ReferenceEquals for case of strings.

Parameters
str1First string to compare.
str2Second string to compare.
Returns
true if strings match, false otherwise.

◆ ReferenceEquals() [4/5]

template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type System::Object::ReferenceEquals ( T const & objA,
std::nullptr_t  )
inlinestatic

Reference-compares value type object with nullptr.

Template Parameters
TType of object to compare.
Parameters
objAFirst object to compare.
Returns
Always returns false as value types cannot be nulled.

◆ ReferenceEquals() [5/5]

template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type System::Object::ReferenceEquals ( T const & objA,
T const & objB )
inlinestatic

Compares objects by reference.

Template Parameters
TType of objects to compare.
Parameters
objAFirst object to compare.
objBSecond object to compare.
Returns
True if object addresses match and false otherwise.

◆ RemovedSharedRefs()

int System::Object::RemovedSharedRefs ( int count)
inline

Decreases shared reference count by specified value.

Implementation.

Parameters
countNumber of shared references to remove.
Returns
Decreased value of shared reference counter.

◆ SetTemplateWeakPtr()

virtual void System::Object::SetTemplateWeakPtr ( uint32_t argument)
virtual

Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.

Parameters
argumentIndex of template argument to treat as weak poiner.

Reimplemented in Aspose::Page::EPS::Util::ThreadLocal< T >, Aspose::Page::XPS::Features::EventBasedModifications::BeforeSavingEventArgs< typename >, Aspose::Page::XPS::XpsModel::XpsArray< typename >, Aspose::Page::XPS::XpsModel::XpsArray< System::SharedPtr< Aspose::Page::XPS::XpsModel::XpsPathFigure > >, Aspose::Page::XPS::XpsModel::XpsArray< System::SharedPtr< Aspose::Page::XPS::XpsModel::XpsPathSegment > >, Aspose::Page::XPS::XpsModel::XpsElement, Aspose::Page::XPS::XpsModel::XpsPathFigure, Aspose::Page::XPS::XpsModel::XpsPathGeometry, System::Array< T >, System::Collections::BitArray, System::Collections::CollectionBase< T >, System::Collections::CollectionBase< SharedPtr< System::Xml::Schema::XmlSchemaObject > >, System::Collections::Generic::BaseKVCollection< Dict, KV >, System::Collections::Generic::BaseKVCollection< Dict, Dict::map_t::key_type >, System::Collections::Generic::BaseKVCollection< Dict, Dict::map_t::mapped_type >, System::Collections::ObjectModel::Collection< T >, System::Collections::ObjectModel::Collection< TItem >, System::Collections::ObjectModel::KeyedCollection< TKey, TItem >, System::Collections::ObjectModel::ReadOnlyCollection< T >, System::Net::Http::Headers::HttpHeaderValueCollection< T >, System::Net::Http::Headers::HttpHeaderValueCollection< System::String >, System::Net::Http::Headers::ObjectCollection< T >, and System::Xml::Schema::XmlSchemaObjectCollection.

◆ SharedCount()

int System::Object::SharedCount ( ) const
inline

Gets current value of shared reference counter.

Implementation.

Returns
Current value of shared reference counter.

◆ SharedRefAdded()

Object * System::Object::SharedRefAdded ( )
inline

Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector.

Implementation.

Returns
Raw pointer to current object.

◆ SharedRefRemovedSafe()

int System::Object::SharedRefRemovedSafe ( )
inline

Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector.

Implementation.

Returns
Decremented value of shared reference counter.

◆ ToString()

virtual String System::Object::ToString ( ) const
virtual

Analog of C# Object.ToString() method. Enables converting custom objects to string.

Returns
String representation as provided by final class.

Reimplemented in Aspose::Page::Drawing::Color, Aspose::Page::Drawing::Size, Aspose::Page::EPS::Device::PdfDevice, Aspose::Page::EPS::XMP::XmpValue, Aspose::Page::Margins, Aspose::Page::Plugins::StringResult, Aspose::Page::XPS::XpsModel::XpsColor, Aspose::Page::XPS::XpsModel::XpsGlyphMapping, Aspose::Page::XPS::XpsModel::XpsGlyphsClusterMap, Aspose::Page::XPS::XpsModel::XpsIccBasedColor, Aspose::Page::XPS::XpsModel::XpsMatrix, Aspose::Page::XPS::XpsModel::XpsRgbColor, Aspose::Zip::ZipEntry, Aspose::Zip::ZipFile, System::BoxedEnum< E, UT >, System::BoxedValue< T >, System::DefaultBoxedValue< T >, System::Drawing::Imaging::ImageFormat, System::Drawing::Printing::PaperSize, System::Globalization::CompareInfo, System::Globalization::CultureInfo, System::Globalization::RegionInfo, System::Globalization::SortKey, System::Globalization::TextInfo, System::IConvertible, System::IO::DirectoryInfo, System::IO::FileInfo, System::IO::StringWriter, System::Net::Cache::HttpRequestCachePolicy, System::Net::Cache::RequestCachePolicy, System::Net::Cookie, System::Net::DnsEndPoint, System::Net::Http::Headers::AuthenticationHeaderValue, System::Net::Http::Headers::CacheControlHeaderValue, System::Net::Http::Headers::ContentDispositionHeaderValue, System::Net::Http::Headers::ContentRangeHeaderValue, System::Net::Http::Headers::EntityTagHeaderValue, System::Net::Http::Headers::HttpHeaders, System::Net::Http::Headers::HttpHeaderValueCollection< T >, System::Net::Http::Headers::HttpHeaderValueCollection< System::String >, System::Net::Http::Headers::MediaTypeHeaderValue, System::Net::Http::Headers::NameValueHeaderValue, System::Net::Http::Headers::NameValueWithParametersHeaderValue, System::Net::Http::Headers::ProductHeaderValue, System::Net::Http::Headers::ProductInfoHeaderValue, System::Net::Http::Headers::RangeConditionHeaderValue, System::Net::Http::Headers::RangeHeaderValue, System::Net::Http::Headers::RangeItemHeaderValue, System::Net::Http::Headers::RetryConditionHeaderValue, System::Net::Http::Headers::StringWithQualityHeaderValue, System::Net::Http::Headers::TransferCodingHeaderValue, System::Net::Http::Headers::ViaHeaderValue, System::Net::Http::Headers::WarningHeaderValue, System::Net::Http::HttpMethod, System::Net::Http::HttpRequestMessage, System::Net::Http::HttpResponseMessage, System::Net::IPAddress, System::Net::IPEndPoint, System::Net::IPHostEntry, System::Net::SocketAddress, System::Net::WebHeaderCollection, System::Security::Cryptography::RSAEncryptionPadding, System::Security::Cryptography::RSASignaturePadding, System::Security::Cryptography::X509Certificates::X509Certificate2, System::Security::Cryptography::X509Certificates::X509Certificate, System::Security::SecurityElement, System::Text::RegularExpressions::Capture, System::Text::RegularExpressions::Regex, System::Text::StringBuilder, System::TimeZoneInfo, System::Uri, System::UriBuilder, System::Xml::Schema::XmlAtomicValue, System::Xml::XmlQualifiedName, and System::Xml::XPath::XPathNavigator.

◆ Type()

static const TypeInfo & System::Object::Type ( )
inlinestatic

Implements C# typeof(System.Object) construct.

Returns
TypeInfo object which describes System::Object type.

◆ Unlock()

void System::Object::Unlock ( )

Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.

◆ WeakRefAdded()

Detail::SmartPtrCounter * System::Object::WeakRefAdded ( )
inline

Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector.

Implementation.

Returns
Pointer to reference counting data structure associated with object.

◆ WeakRefRemoved()

void System::Object::WeakRefRemoved ( )
inline

Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector.

Implementation.