C++ class design


 
Thread Tools Search this Thread
Top Forums Programming C++ class design
# 1  
Old 11-21-2006
C++ class design

Can anybody tell me what is the best website or books to read for getting good knowledge in doing C++ class design. Please leave cplusplus.com or bjorne stroustrup. Other than these is there any website or book. Please do tell me
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

C++ : Base class member function not accessible from derived class

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

Size of Derived class, upon virtual base class inheritance

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

C++ string class design and implementation

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

Get pointer for existing device class (struct class) in Linux kernel module

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

static use for class inside the same class c++

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

C++ class definition with a member of the same class

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

car class (not school class)

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 design a program

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
Login or Register to Ask a Question
Class::Load(3)						User Contributed Perl Documentation					    Class::Load(3)

NAME
Class::Load - a working (require "Class::Name") and more VERSION
version 0.20 SYNOPSIS
use Class::Load ':all'; try_load_class('Class::Name') or plan skip_all => "Class::Name required to run these tests"; load_class('Class::Name'); is_class_loaded('Class::Name'); my $baseclass = load_optional_class('Class::Name::MightExist') ? 'Class::Name::MightExist' : 'Class::Name::Default'; DESCRIPTION
"require EXPR" only accepts "Class/Name.pm" style module names, not "Class::Name". How frustrating! For that, we provide "load_class 'Class::Name'". It's often useful to test whether a module can be loaded, instead of throwing an error when it's not available. For that, we provide "try_load_class 'Class::Name'". Finally, sometimes we need to know whether a particular class has been loaded. Asking %INC is an option, but that will miss inner packages and any class for which the filename does not correspond to the package name. For that, we provide "is_class_loaded 'Class::Name'". FUNCTIONS
load_class Class::Name, \%options "load_class" will load "Class::Name" or throw an error, much like "require". If "Class::Name" is already loaded (checked with "is_class_loaded") then it will not try to load the class. This is useful when you have inner packages which "require" does not check. The %options hash currently accepts one key, "-version". If you specify a version, then this subroutine will call "Class::Name->VERSION( $options{-version} )" internally, which will throw an error if the class's version is not equal to or greater than the version you requested. This method will return the name of the class on success. try_load_class Class::Name, \%options -> (0|1, error message) Returns 1 if the class was loaded, 0 if it was not. If the class was not loaded, the error will be returned as a second return value in list context. Again, if "Class::Name" is already loaded (checked with "is_class_loaded") then it will not try to load the class. This is useful when you have inner packages which "require" does not check. Like "load_class", you can pass a "-version" in %options. If the version is not sufficient, then this subroutine will return false. is_class_loaded Class::Name, \%options -> 0|1 This uses a number of heuristics to determine if the class "Class::Name" is loaded. There heuristics were taken from Class::MOP's old pure- perl implementation. Like "load_class", you can pass a "-version" in %options. If the version is not sufficient, then this subroutine will return false. load_first_existing_class Class::Name, \%options, ... This attempts to load the first loadable class in the list of classes given. Each class name can be followed by an options hash reference. If any one of the classes loads and passes the optional version check, that class name will be returned. If none of the classes can be loaded (or none pass their version check), then an error will be thrown. If, when attempting to load a class, it fails to load because of a syntax error, then an error will be thrown immediately. load_optional_class Class::Name, \%options -> 0|1 "load_optional_class" is a lot like "try_load_class", but also a lot like "load_class". If the class exists, and it works, then it will return 1. If you specify a version in %options, then the version check must succeed or it will return 0. If the class doesn't exist, and it appears to not exist on disk either, it will return 0. If the class exists on disk, but loading from disk results in an error ( i.e.: a syntax error ), then it will "croak" with that error. This is useful for using if you want a fallback module system, i.e.: my $class = load_optional_class($foo) ? $foo : $default; That way, if $foo does exist, but can't be loaded due to error, you won't get the behaviour of it simply not existing. SEE ALSO
<http://blog.fox.geek.nz/2010/11/searching-design-spec-for-ultimate.html> This blog post is a good overview of the current state of the existing modules for loading other modules in various ways. <http://blog.fox.geek.nz/2010/11/handling-optional-requirements-with.html> This blog post describes how to handle optional modules with Class::Load. <http://d.hatena.ne.jp/tokuhirom/20110202/1296598578> This Japanese blog post describes why DBIx::Skinny now uses Class::Load over its competitors. Moose, Jifty, Prophet, etc This module was designed to be used anywhere you have "if (eval "require $module"; 1)", which occurs in many large projects. AUTHOR
Shawn M Moore <sartak at bestpractical.com> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Shawn M Moore. 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.18.2 2012-07-15 Class::Load(3)