8 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. Programming
Hi,
I am designing the look-alike C++ string class:
#include <iostream>
#include <cstring>
#include <exception>
#include <new>
#define ALLOC(N) (char*) new char
#define DELETE(P) delete ((char*)(P))
class String {
public:
// conversions: to C-like type char
operator const... (2 Replies)
Discussion started by: royalibrahim
2 Replies
4. 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
5. 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
6. 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
7. 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
8. Shell Programming and Scripting
i want to make a shell program.
This program i give a current day and the result is to appear
the celebrity and birthday(birthday and celebration is 2 txt files).
In addition this procedure must do for a space day in future or past depend
on user choice. Finally the program can run and as... (2 Replies)
Discussion started by: mytilini boy
2 Replies
Git::Repository::Plugin(3pm) User Contributed Perl Documentation Git::Repository::Plugin(3pm)
NAME
Git::Repository::Plugin - Base class for Git::Repository plugins
SYNOPSIS
package Git::Repository::Plugin::Hello;
use Git::Repository::Plugin;
our @ISA = qw( Git::Repository::Plugin );
sub _keywords { return qw( hello hello_gitdir ) }
sub hello { return "Hello, git world!
"; }
sub hello_gitdir { return "Hello, " . $_[0]->git_dir . "!
"; }
1;
DESCRIPTION
"Git::Repository::Plugin" allows one to define new methods for "Git::Repository", that will be imported in the "Git::Repository" namespace.
The SYNOPSIS provides a full example.
The documentation of Git::Repository describes how to load plugins with all the methods they provide, or only a selection of them.
METHODS
"Git::Repository::Plugin" provides a single method:
install( @keywords )
Install all keywords provided in the "Git::Repository" namespace.
If called with an empty list, will install all available keywords.
SUBCLASSING
When creating a plugin, the new keywords that are added by the plugin to "Git::Repository" must be returned by a "_keywords()" method.
AUTHOR
Philippe Bruhat (BooK), "<book at cpan.org>"
ACKNOWLEDGEMENTS
Thanks to Todd Rinalo, who wanted to add more methods to "Git::Repository", which made me look for a solution that would preserve the
minimalism of "Git::Repository".
After a not-so-good design using @ISA (so "Git::Repository" would inherit the extra methods), further discussions with Aristotle Pagaltzis
and a quick peek at Dancer's plugin management helped me come up with the current design. Thank you Aristotle and the Dancer team.
Further improvements to the plugin system proposed by Aristotle Pagaltzis.
COPYRIGHT
Copyright 2010 Philippe Bruhat (BooK).
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2011-12-28 Git::Repository::Plugin(3pm)