10-11-2013
Restricting member of a class non-inheritable in C++
There is base class B, and two derived classes D1 and D2 derived from Base. Base class B, have two data members ( public or protected or private or if any). D1 should inherit both these data members, and D2 should be deriving only one member from Base class. Is this kind of design possible without using "friend" concept ? Language - C++.
10 More Discussions You Might Find Interesting
1. Solaris
Hi All,
I'm on Solaris 8, I need to provide Read-only access to a user to 2 directories only.
Using rsh (restricted shell) as the user's login shell, I can restrict the user's access to a certain directory only, but how can I set in such a way that the user can access only the 2 directories... (4 Replies)
Discussion started by: max_min
4 Replies
2. Programming
Hello,
i am using the sigaction function to handle the SIGCHLD signal.Is it possible to use a class member function as the handler function (the sa_handler member of the sigaction structure)?
The function's signature is:
void (*sa_handler)(int);so i don't think i can use a static member function... (2 Replies)
Discussion started by: Zipi
2 Replies
3. 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
4. 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
5. Shell Programming and Scripting
how can i make my users to not use particular commands in the network
like:wall.......
pl z help me regarding this (1 Reply)
Discussion started by: yashwanthguru
1 Replies
6. Programming
I have the following class and thought that when I call the set command to set a member, I always use value. Would that be fine?
class ModMisfit {
protected:
Real dtau;
Real mdacc;
Real mindist;
bool hw;
Source** src;
public:
void ... (7 Replies)
Discussion started by: kristinu
7 Replies
7. 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
8. 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
9. 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
10. 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
LEARN ABOUT OSX
localsocketbase
FBB::LocalSocketBase(3bobcat) Base class for Unix Domain sockets FBB::LocalSocketBase(3bobcat)
NAME
FBB::LocalSocketBase - Base class for Unix Domain socket-constructing classes
SYNOPSIS
#include <bobcat/localsocketbase>
Linking option: -lbobcat
DESCRIPTION
This class is a base class for the FBB::LocalServerSocket and FBB::LocalClientSocket classes. Since it is designed as a base class, its
constructor is protected. All its remaining members are protected as well.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
INHERITS FROM
-
PROTECTED CONSTRUCTOR
o LocalSocketBase():
The default constructor merely constructs a FBB::LocalSocketBase object. Before the object can be used, its open() member must be
called first.
o LocalSocketBase(string const &name):
This constructor creates a LocalSocketBase using the file specified in name as the Unix domain socket interface. If the socket
could not be constructed, an FBB::Errno exception is thrown. The copy constructor is not available.
PROTECTED MEMBER FUNCTIONS
o open(string const &name):
This member initiaizes a LocalSocketBase object following its construction using the default constructor. The file specified in name
is used as the Unix domain socket interface. If the socket could not be constructed, an FBB::Errno exception is thrown.
o size_t size() const:
Accessor returning the size of the object's sockaddr_un (address)
o int socket() const:
This accessor returns the FBB::LocalSocketBase's socket value.
o sockaddr const *sockaddrPtr() const:
Accessor returning the pointer to the object's sockaddr.
EXAMPLE
See the examples presented with the localclientsocket(3bobcat) and localserversocket(3bobcat) classes.
FILES
bobcat/localsocketbase - defines the class interface
SEE ALSO
bobcat(7), localclientsocket(3bobcat), localserversocket(3bobcat), socketbase(3bobcat)
BUGS
None Reported.
DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature;
o bobcat_3.01.00-x.tar.gz: source archive;
o bobcat_3.01.00-x_i386.changes: change log;
o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries;
o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages;
o http://sourceforge.net/projects/bobcat: public archive location;
BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL).
AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl).
libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::LocalSocketBase(3bobcat)