class QPanda::CMem

Overview

CMem abstract class, this class is considered as the container of the CBit. More…

#include <CMemFactory.h>

class CMem
{
public:
    // methods

    virtual CBit* Allocate_CBit() = 0;
    virtual CBit* Allocate_CBit(size_t) = 0;
    virtual size_t getMaxMem() const = 0;
    virtual size_t getIdleMem() const = 0;
    virtual void Free_CBit(CBit*) = 0;
    virtual void clearAll() = 0;
    virtual size_t get_allocate_cbits(std::vector<CBit*>&) = 0;
};

// direct descendants

class OriginCMem;
class OriginCMemv2;

Detailed Documentation

CMem abstract class, this class is considered as the container of the CBit.

Methods

virtual CBit* Allocate_CBit() = 0

allocate a CBit

Returns:

CBit*

virtual CBit* Allocate_CBit(size_t) = 0

allocate a CBit by bit address

Returns:

CBit*

virtual size_t getMaxMem() const = 0

get size of the CBit vector

Returns:

size_t

virtual size_t getIdleMem() const = 0

get size of the idle position

Returns:

size_t

virtual void Free_CBit(CBit*) = 0

free a CBit

Parameters:

CBit*

virtual void clearAll() = 0

clear the CBit vector

virtual size_t get_allocate_cbits(std::vector<CBit*>&) = 0

get allocate cbits

Parameters:

std::vector<CBit

*>&

Returns:

size_t allocate cbits size