Class AbstractClass

Inheritance Relationships

Base Type

Class Documentation

class AbstractClass : public mindspore::abstract::AbstractBase

Class AbstractClass describes a class node’s abstract value.

Public Functions

inline AbstractClass(const Named &tag, const std::vector<AbstractAttribute> &attributes, const mindspore::HashMap<std::string, ValuePtr> &methods)

Constructor of AbstractClass.

Parameters
  • tag[in] The name of the class.

  • attributes[in] The abstracts of the attributes of the class.

  • methods[in] The methods of the class.

~AbstractClass() override = default

Destructor of AbstractClass.

inline const std::vector<AbstractAttribute> &attributes() const

Get the attributes.

Returns

A vector of the attributes.

inline mindspore::HashMap<std::string, ValuePtr> methods()

get the methods of the class.

Returns

A map of the method names and methods.

AbstractBasePtr GetAttribute(const std::string &name)

Get a attribute by name.

Parameters

name[in] The attribute name of the class.

Returns

A pointer to the abstract.

ValuePtr GetMethod(const std::string &name)

Get a method by name.

Parameters

name[in] The attribute name of the class.

Returns

A pointer to the value.

virtual AbstractBasePtr Clone() const override

Clone an abstract from the abstract.

Returns

A pointer to the cloned abstract.

virtual AbstractBasePtr Broaden() const override

Broaden the abstract. It will upgrade the abstract to a higher level.

Returns

A pointer to the broadened abstract.

virtual std::string ToString() const override

Get the string representation of this object.

Returns

The string representation.

inline Named tag() const

Get the tag in the class.

Returns

An instance of Named.

virtual std::size_t hash() const override

Get the hash value of this object.

Returns

The hash value.