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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)