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
Validation::Class::Exporter(3pm) User Contributed Perl Documentation Validation::Class::Exporter(3pm)
NAME
Validation::Class::Exporter - Simple Exporter for Validation::Class Classes
VERSION
version 7.70
SYNOPSIS
package MyApp::Class;
use Validation::Class;
use Validation::Class::Exporter;
Validation::Class::Exporter->apply_spec(
routines => ['thing'], # export routines as is
settings => [ ... ] # passed to the "load" method, see Validation::Class
);
has foo => 0;
bld sub {
shift->foo(1);
};
sub thing {
my $args = pop;
my $class = shift || caller;
# routine as a keyword
$class->{config}->{THING} = [$args];
};
package MyApp::Example;
use MyApp::Class;
thing ['this' => 'that'];
package main;
my $eg = MyApp::Example->new; # we have lift-off!!!
DESCRIPTION
This module (while experimental) encapsulates the exporting of keywords and routines. It applies the Validation::Class framework along with
any keyword routines and/or sub-routines specified with the apply_spec() method. It does this by simply by copying the spec into the
calling class.
To simplify writing exporter modules, "Validation::Class::Exporter" also imports "strict" and "warnings" into your exporter module, as well
as into modules that use it.
METHODS
apply_spec
When you call this method, "Validation::Class::Exporter" builds a custom "import" method on the calling class. The "import" method will
export the functions you specify, and can also automatically export "Validation::Class" making the calling class a Validation::Class
derived class.
This method accepts the following parameters:
o routines => [ ... ]
This list of function names only will be exported into the calling class exactly as is, the functions can be used traditionally or
as keywords so their parameter handling should be configured accordingly.
o settings => [ ... ]
This list of key/value pair will be passed to the load method imported from "Validation::Class::load" and will be applied on the
calling class.
This approach affords you some trickery in that you can utilize the load method to apply the current class' configuration to the
calling class' configuration, etc.
AUTHOR
Al Newkirk <anewkirk@ana.io>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Al Newkirk.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-06-28 Validation::Class::Exporter(3pm)