OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [common/] [attribute.h] - Diff between revs 2 and 4

Show entire file | Details | Blame | View Log

Rev 2 Rev 4
Line 1... Line 1...
/**
/*
 * @file
 *  Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
 *
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
 *  Licensed under the Apache License, Version 2.0 (the "License");
 * @brief      Core attribute class declaration.
 *  you may not use this file except in compliance with the License.
 
 *  You may obtain a copy of the License at
 
 *
 
 *      http://www.apache.org/licenses/LICENSE-2.0
 
 *
 
 *  Unless required by applicable law or agreed to in writing, software
 
 *  distributed under the License is distributed on an "AS IS" BASIS,
 
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
 *  See the License for the specific language governing permissions and
 
 *  limitations under the License.
 */
 */
 
 
#ifndef __DEBUGGER_ATTRIBUTE_H__
#ifndef __DEBUGGER_ATTRIBUTE_H__
#define __DEBUGGER_ATTRIBUTE_H__
#define __DEBUGGER_ATTRIBUTE_H__
 
 
#include <stdint.h>
#include <stdint.h>
#include <string.h>
#include <string.h>
#include "iattr.h"
#include <iattr.h>
 
 
namespace debugger {
namespace debugger {
 
 
enum KindType {
enum KindType {
        Attr_Invalid,
        Attr_Invalid,
Line 61... Line 70...
    }
    }
    ~AttributeType() {
    ~AttributeType() {
        attr_free();
        attr_free();
    }
    }
 
 
 
    /** IAttribute */
 
    virtual void allocAttrName(const char *name);
 
    virtual void freeAttrName();
 
    virtual void allocAttrDescription(const char *descr);
 
    virtual void freeAttrDescription();
 
 
    void attr_free();
    void attr_free();
 
 
    explicit AttributeType(const char *str) {
    explicit AttributeType(const char *str) {
        make_string(str);
        make_string(str);
    }
    }
Line 114... Line 129...
 
 
    int to_int() const {
    int to_int() const {
        return static_cast<int>(u_.integer);
        return static_cast<int>(u_.integer);
    }
    }
 
 
    int to_uint32() const {
    uint32_t to_uint32() const {
        return static_cast<uint32_t>(u_.integer);
        return static_cast<uint32_t>(u_.integer);
    }
    }
 
 
    int64_t to_int64() const {
    int64_t to_int64() const {
        return u_.integer;
        return u_.integer;
Line 237... Line 252...
 
 
    void make_data(unsigned size);
    void make_data(unsigned size);
 
 
    void make_data(unsigned size, const void *data);
    void make_data(unsigned size, const void *data);
 
 
 
    void realloc_data(unsigned size);
 
 
    void make_list(unsigned size);
    void make_list(unsigned size);
 
 
    void add_to_list(const AttributeType *item) {
    void add_to_list(const AttributeType *item) {
        realloc_list(size()+1);
        realloc_list(size()+1);
        (*this)[size()-1] = (*item);
        (*this)[size()-1] = (*item);
Line 318... Line 335...
    /**
    /**
     * @brief Access to the single byte of the 'data' attribute:
     * @brief Access to the single byte of the 'data' attribute:
     */
     */
    const uint8_t& operator()(unsigned idx) const;
    const uint8_t& operator()(unsigned idx) const;
 
 
    char *to_config();
    const AttributeType& to_config();
    void from_config(const char *str);
    void from_config(const char *str);
};
};
 
 
class AttributePairType {
class AttributePairType {
  public:
  public:

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.