7 More Discussions You Might Find Interesting
1. Programming
Hello All,
I am a learner in C++. I was testing my inheritance knowledge with following piece of code.
#include <iostream>
using namespace std;
class base
{
public :
void display()
{
cout << "In base display()" << endl;
}
void display(int k)
{... (2 Replies)
Discussion started by: anand.shah
2 Replies
2. Programming
I have the two class definition as follows.
class A { public: int a; };
class B : virtual public A{ };
The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Discussion started by: techmonk
2 Replies
3. UNIX for Advanced & Expert Users
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies
4. Programming
Hi,
I believe the next code is wrong:
class Egg {
Egg e;
int i;
Egg(int ii=0) : i(ii) {}
};
because you would end up with an endless definition (memory allocation) of Egg objects, thus int i.
Ok, so God Eckel proposes for a singleton:
class Egg {
static Egg e;
int... (5 Replies)
Discussion started by: xavipoes
5 Replies
5. Programming
Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento)
typedef struct elemento
{
char name;
char value;
List<struct elemento> ltElementos;
... (7 Replies)
Discussion started by: pogdorica
7 Replies
6. UNIX for Dummies Questions & Answers
im just trying to have some fun and kill some time writing a c++ program that has a person type in a car make and model then gives them a year and a price. or something like that. i always have problems getting it goin but once the ball is rolling im usually pretty good. anyone wanna help me out? ... (1 Reply)
Discussion started by: rickym2626
1 Replies
7. Shell Programming and Scripting
hi anbu23 u have just replied to my post i want to ask u something else can we get into contact thanks
or reply itself
mv -f $XXTEST_TOP/install/SPE1/XXTEST_SPE1_XX_QUOTE_DETAILS_TBL.sql $XXTEST_TOP/admin2/sql
if
then
echo "Move is successful"
fi
1. What u mean by $? here can u be... (1 Reply)
Discussion started by: Lutchumaya
1 Replies
LEARN ABOUT DEBIAN
class::meta::constructor
Class::Meta::Constructor(3pm) User Contributed Perl Documentation Class::Meta::Constructor(3pm)
NAME
Class::Meta::Constructor - Class::Meta class constructor introspection
SYNOPSIS
# Assuming MyApp::Thingy was generated by Class::Meta.
my $class = MyApp::Thingy->my_class;
print "
Constructors:
";
for my $ctor ($class->constructors) {
print " o ", $ctor->name, $/;
my $thingy = $ctor->call($class->package);
}
DESCRIPTION
This class provides an interface to the "Class::Meta" objects that describe class constructors. It supports a simple description of the
constructor, a label, and the constructor visibility (private, protected, trusted,or public).
Class::Meta::Constructor objects are created by Class::Meta; they are never instantiated directly in client code. To access the constructor
objects for a Class::Meta-generated class, simply call its "my_class()" method to retrieve its Class::Meta::Class object, and then call the
"constructors()" method on the Class::Meta::Class object.
INTERFACE
Constructors
new
A protected method for constructing a Class::Meta::Constructor object. Do not call this method directly; Call the "add_constructor()"
method on a Class::Meta object, instead.
Instance Methods
name
my $name = $ctor->name;
Returns the constructor name.
package
my $package = $ctor->package;
Returns the package name of the class that constructor is associated with.
desc
my $desc = $ctor->desc;
Returns the description of the constructor.
label
my $desc = $ctor->label;
Returns label for the constructor.
view
my $view = $ctor->view;
Returns the view of the constructor, reflecting its visibility. The possible values are defined by the following constants:
Class::Meta::PUBLIC
Class::Meta::PRIVATE
Class::Meta::TRUSTED
Class::Meta::PROTECTED
class
my $class = $ctor->class;
Returns the Class::Meta::Class object that this constructor is associated with. Note that this object will always represent the class in
which the constructor is defined, and not any of its subclasses.
call
my $obj = $ctor->call($package, @params);
Executes the constructor. Pass in the name of the class for which it is being executed (since, thanks to subclassing, it may be different
than the class with which the constructor is associated). All other parameters will be passed to the constructor. Note that it uses a
"goto" to execute the constructor, so the call to "call()" itself will not appear in a call stack trace.
build
$ctor->build($class);
This is a protected method, designed to be called only by the Class::Meta class or a subclass of Class::Meta. It takes a single argument,
the Class::Meta::Class object for the class in which the constructor was defined, and generates constructor method for the
Class::Meta::Constructor, either by installing the code reference passed in the "code" parameter or by creating the constructor from
scratch.
Although you should never call this method directly, subclasses of Class::Meta::Constructor may need to override its behavior.
BUGS
Please send bug reports to <bug-class-meta@rt.cpan.org> or report them via the CPAN Request Tracker at
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Meta <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Meta>.
SUPPORT
This module is stored in an open GitHub repository <http://github.com/theory/class-meta/>. Feel free to fork and contribute!
Please file bug reports via GitHub Issues <http://github.com/theory/class-meta/issues/> or by sending mail to bug-Class-Meta.cpan.org
<mailto:bug-Class-Meta.cpan.org>.
AUTHOR
David E. Wheeler <david@justatheory.com>
SEE ALSO
Other classes of interest within the Class::Meta distribution include:
Class::Meta
Class::Meta::Class
Class::Meta::Method
Class::Meta::Attribute
COPYRIGHT AND LICENSE
Copyright (c) 2002-2011, David E. Wheeler. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.4 2011-08-06 Class::Meta::Constructor(3pm)