clibgen.api.ConstructorDefinition
R2026bDescription
A clibgen.api.ConstructorDefinition object represents the
MATLAB® definition of a C++ constructor.
Creation
creates a
constructor definition object from the ctor = classDef.ConstructorsConstructors property of a clibgen.api.ClassDefinition
object.
creates a
constructor definition from the ctor = classDef.ConstructorsIncompleteConstructors property.
Properties
This property is read-only.
Name of the C++ class that contains the constructor, represented as a string scalar.
This property is read-only.
MATLAB name for the C++ constructor, represented as a string scalar.
This property is read-only.
Fully qualified name of the C++ class that contains the constructor, represented as a string scalar.
This property is read-only.
C++ signature of the constructor, represented as a string scalar.
This property is read-only.
MATLAB signature for the constructor, represented as a string scalar.
This property is read-only.
MATLAB definition of the C++ parameters, represented as a clibgen.api.InputArgumentDefinition object.
This property is read-only.
Whether the constructor requires additional definition, represented as
Complete or Incomplete.
Whether this construct is included in the interface, specified as a numeric or logical
1 (true) or 0
(false).
Doxygen @brief comments for the constructor from the header file,
specified as a string scalar. If the header file does not contain
@brief comments, the text for Description
is:
MATLABName Representation of C++ class constructor CPPName.
Use the Description property to modify the description in the
ConstructorDefinition object.
Doxygen @details comments from the header file, specified as a
string scalar. If the C++ file does not contain a comment about the constructor, then
DetailedDescription is empty and does not appear in the
definition file.
If DetailedDescription is not empty, then the MATLAB
doc command displays the following sentence before displaying the value
of DetailedDescription:
This content is from the external library documentation.
Use the DetailedDescription property to provide more information about
the interface definition file.
Examples
icfg = clibgen.api.InterfaceConfiguration("exctors"); icfg.HeaderFiles = "example_constructors.hpp"; icfg.IncludePath = "."; idef = clibgen.api.InterfaceDefinition(icfg);
Display complete constructors through the ClassDefinition.
classDef = findClass(idef,"Rectangle");
classDef.Constructorsans =
1×5 ConstructorDefinition array with properties:
OwningClassName
CPPSignature
MATLABSignature
CPPInputs
Status
Included
Display as table
If there are multiple constructors, click the Display as table
link.
CPPSignature Status Included
___________________________________________________ __________ ________
"Rectangle::Rectangle()" Complete true
"Rectangle::Rectangle(double side)" Complete true
"Rectangle::Rectangle(double width,double height)" Complete true
"Rectangle::Rectangle(double const * dims,int len)" Incomplete false
"Rectangle::Rectangle(Rectangle const & input1)" Complete true
Find a specific overload using findConstructor with input type
matching:
ctor = findConstructor(classDef,CPPInputTypeNames=["double","double"])
ctor =
ConstructorDefinition with properties:
OwningClassName: "Rectangle"
CPPSignature: "Rectangle::Rectangle(double width,double height)"
MATLABSignature: clib.exctors.Rectangle/Rectangle(width, height)
CPPInputs: [1×2 clibgen.api.InputArgumentDefinition]
Status: Complete
Included: trueVersion History
Introduced in R2026b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)