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.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)