Personal tools
You are here: Home Projects C++ Cfront releases Release 3.0.3 source incl-master const-headers Vblock.h
Document Actions

Vblock.h

by Michael L Powell last modified 2007-01-26 03:20

Click here to get the file

Size 2.0 kB - File type text/plain

File contents

/*ident	"@(#)Vblock.h	1.1.2.3" */
/******************************************************************************
*
* C++ Standard Components, Release 3.0.
*
* Copyright (c) 1991, 1992 AT&T and Unix System Laboratories, Inc.
* Copyright (c) 1988, 1989, 1990 AT&T.  All Rights Reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T and Unix System
* Laboratories, Inc.  The copyright notice above does not evidence
* any actual or intended publication of such source code.
*
******************************************************************************/

#ifndef VBLOCKH
#define VBLOCKH

#include <Block.h>

class Vb_ATTLC{
public:
    Vb_ATTLC();
    virtual ~Vb_ATTLC();
    virtual unsigned size() const =0;
    virtual unsigned size(unsigned)=0;
    virtual void* elem(int i)=0;
    virtual void* beginning()=0;
    virtual void* finish()=0;
};

#ifdef __GNUG__
#pragma interface
#endif

template <class T>
class Vblock : public Vb_ATTLC {
public:
#ifdef __GNUG__
    unsigned size() const { return B.size(); }
    unsigned size(unsigned k) { return B.size(k); }
#else
    unsigned size() const;
    unsigned size(unsigned k);
#endif

    Vblock(){}
    Vblock(unsigned k):B(k){}
    Vblock(const Vblock<T>& b):B(b.B){}
#ifdef __GNUG__
    ~Vblock() {}
#else
    ~Vblock();
#endif

    Vblock<T>& operator=(const Vblock<T>& b){
	B=b.B;
	return *this;
    }
    operator T*() { return (T*)B; }
    T* end(){ return B.end(); }
    T& operator[](int i) { return B.operator [](i);}
    const T& operator[](int i) const { return B.operator [](i); }
    int reserve(unsigned k) { return B.reserve(k); }
    void swap(Vblock<T>& b){B.swap(b.B);}
private:
    Block<T> B;

#ifdef __GNUG__
    void* elem(int i) { return (void*)&B[i]; }

    void* beginning() { return (T*)(*this); }

    void* finish() { return end(); }
#else
    void* elem(int i);

    void* beginning();

    void* finish();
#endif
};

#if defined(__edg_att_40) && !defined(__IMPLICIT_INCLUDE)
#include <Vblock.c>
#endif
#endif
« March 2024 »
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: