(file) Return to ArrayInter.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

File: [Pegasus] / pegasus / src / Pegasus / Common / ArrayInter.h (download)
Revision: 1.29, Tue Dec 2 09:00:37 2008 UTC (15 years, 6 months ago) by martin
Branch: MAIN
CVS Tags: preBug9676, postBug9676, TASK_PEP317_1JUNE_2013, TASK-TASK_PEP362_RestfulService_branch-root, TASK-TASK_PEP362_RestfulService_branch-merged_out_from_trunk, TASK-TASK_PEP362_RestfulService_branch-merged_in_to_trunk, TASK-TASK_PEP362_RestfulService_branch-merged_in_from_branch, TASK-TASK_PEP362_RestfulService_branch-branch, TASK-PEP362_RestfulService-root, TASK-PEP362_RestfulService-merged_out_to_branch, TASK-PEP362_RestfulService-merged_out_from_trunk, TASK-PEP362_RestfulService-merged_in_to_trunk, TASK-PEP362_RestfulService-merged_in_from_branch, TASK-PEP362_RestfulService-branch, TASK-PEP348_SCMO-root, TASK-PEP348_SCMO-merged_out_to_branch, TASK-PEP348_SCMO-merged_out_from_trunk, TASK-PEP348_SCMO-merged_in_to_trunk, TASK-PEP348_SCMO-merged_in_from_branch, TASK-PEP348_SCMO-branch, TASK-PEP317_pullop-root, TASK-PEP317_pullop-merged_out_to_branch, TASK-PEP317_pullop-merged_out_from_trunk, TASK-PEP317_pullop-merged_in_to_trunk, TASK-PEP317_pullop-merged_in_from_branch, TASK-PEP317_pullop-branch, RELEASE_2_9_2-RC2, RELEASE_2_9_2-RC1, RELEASE_2_9_2, RELEASE_2_9_1-RC1, RELEASE_2_9_1, RELEASE_2_9_0-RC1, RELEASE_2_9_0-FC, RELEASE_2_9_0, RELEASE_2_9-root, RELEASE_2_9-branch, RELEASE_2_14_1, RELEASE_2_14_0-RC2, RELEASE_2_14_0-RC1, RELEASE_2_14_0, RELEASE_2_14-root, RELEASE_2_14-branch, RELEASE_2_13_0-RC2, RELEASE_2_13_0-RC1, RELEASE_2_13_0-FC, RELEASE_2_13_0, RELEASE_2_13-root, RELEASE_2_13-branch, RELEASE_2_12_1-RC1, RELEASE_2_12_1, RELEASE_2_12_0-RC1, RELEASE_2_12_0-FC, RELEASE_2_12_0, RELEASE_2_12-root, RELEASE_2_12-branch, RELEASE_2_11_2-RC1, RELEASE_2_11_2, RELEASE_2_11_1-RC1, RELEASE_2_11_1, RELEASE_2_11_0-RC1, RELEASE_2_11_0-FC, RELEASE_2_11_0, RELEASE_2_11-root, RELEASE_2_11-branch, RELEASE_2_10_1-RC1, RELEASE_2_10_1, RELEASE_2_10_0-RC2, RELEASE_2_10_0-RC1, RELEASE_2_10_0, RELEASE_2_10-root, RELEASE_2_10-branch, PREAUG25UPDATE, POSTAUG25UPDATE, HPUX_TEST, HEAD, CIMRS_WORK_20130824, BeforeUpdateToHeadOct82011
Changes since 1.28: +6 -6 lines
BUG#: 8123
TITLE: Update copyright/license text

DESCRIPTION:

Fixing trailing spaces in copyright/license text

//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////////

// Only include if not included as general template or if explicit instantiation
#if !defined(Pegasus_ArrayInter_h) || defined(PEGASUS_ARRAY_T)
#if !defined(PEGASUS_ARRAY_T)
#define Pegasus_ArrayInter_h
#endif

#include <Pegasus/Common/Linkage.h>

#ifndef PEGASUS_ARRAY_T
/**
    This class is used to represent arrays of intrinsic data types in CIM.
*/
template<class PEGASUS_ARRAY_T> class Array
#else
PEGASUS_TEMPLATE_SPECIALIZATION
    class PEGASUS_COMMON_LINKAGE Array<PEGASUS_ARRAY_T>
#endif
{
public:

    /**
        Constructs an array object with null values (default constructor).
    */
    Array();

    /**
        Creates a new Array object using the parameters and values in the
        Array object.
        @param x Specifies the new Array object name.
    */
    Array(const Array<PEGASUS_ARRAY_T>& x);

    /**
        Constructs an array with size elements. The elements are
        initialized with their copy constructor.
        @param size Defines the number of elements.
    */
    Array(Uint32 size);

    /**
        Constructs an array with size elements. The elements are
        initialized with array x.
        @param size Defines the number of elements.
        @param x Specifies the new array object name.
    */
    Array(Uint32 size, const PEGASUS_ARRAY_T& x);

    /**
        Constructs an array with size elements. The values come from
        the items pointer.
        @param items References the values of the specified array.
        @param size Uint32 representing how many elements are in the array.
    */
    Array(const PEGASUS_ARRAY_T* items, Uint32 size);

    /**
        Destroys the objects, freeing any resources.
    */
    ~Array();

    /**
        The values of one array object are assigned to another (assignment
        operator).
        @param x Array object to assign the Array parameters to.
    */
    Array<PEGASUS_ARRAY_T>& operator=(const Array<PEGASUS_ARRAY_T>& x);

    /**
        Clears the contents of the array. After calling this, size()
        returns zero.
    */
    void clear();

    /**
        Reserves memory for capacity elements. Notice that this does not
        change the size of the array (size() returns what it did before).
        If the capacity of the array is already greater or equal to the
        capacity argument, this method has no effect. After calling
        reserveCapacity(), getCapacity() returns a value which is greater
        or equal to the capacity argument.
        @param capacity Defines the size that is to be reserved
    */
    void reserveCapacity(Uint32 capacity);

    /**
        Make the size of the array grow by size elements. The new size will
        be size() + size. The new elements (there are size of them) are
        initialized with x.
        @param size Defines the number of elements by which the array is to
        grow.
        @param x The element value with which to initialize the new elements.
    */
    void grow(Uint32 size, const PEGASUS_ARRAY_T& x);

    /**
        Swaps the contents of two arrays.  After the swap, Array x references
        the original values of this Array object and this Array object
        references the original values of Array x.
        @param x The Array with which to swap values.
    */
    void swap(Array<PEGASUS_ARRAY_T>& x);

    /**
        Returns the number of elements in the array.
        @return The number of elements in the array.
    */
    Uint32 size() const;

    /**
        Returns the capacity of the array.
        @return The capacity of the array.
    */
    Uint32 getCapacity() const;

    /**
        Returns a pointer to the first element of the array.
        @return A pointer to the first element of the array.
    */
    const PEGASUS_ARRAY_T* getData() const;

    /**
        Returns the element indicated by the index argument.
        @return A reference to the element defined by index so that it may be
        modified.
    */
    PEGASUS_ARRAY_T& operator[](Uint32 index);

    /**
        Returns the element in the const array specified as the index argument.
        The return value cannot be modified since it is constant.
        @return A reference to the element defined by index but the reference
        cannot be modified.
    */
    const PEGASUS_ARRAY_T& operator[](Uint32 index) const;

    /**
        Appends an element to the end of the array. This increases the size
        of the array by one.
        @param x Element to append.
    */
    void append(const PEGASUS_ARRAY_T& x);

    /**
        Appends size elements at x to the end of this array.
        @param x Pointer to a buffer containing the elements to append.
        @param size A Uint32 value specifying the number of elements to append.
    */
    void append(const PEGASUS_ARRAY_T* x, Uint32 size);

    /**
        Appends one array to another. The size of this array grows by the
        size of the other.
        @param x Array to add to the appended array.
    */
    void appendArray(const Array<PEGASUS_ARRAY_T>& x);

    /**
        Appends one element to the beginning of the array. This increases
        the size by one.
        @param x The element to prepend.
    */
    void prepend(const PEGASUS_ARRAY_T& x);

    /**
        Prepends a specified number of elements from a buffer to the array.
        @param x Pointer to a buffer containing the elements to prepend.
        @param size A Uint32 value specifying the number of elements to prepend.
    */
    void prepend(const PEGASUS_ARRAY_T* x, Uint32 size);

    /**
        Inserts the element at the given index in the array. Subsequent
        elements are moved down. The size of the array grows by one.
        @param index The index at which to insert the element into the array.
        @param x Specifies the element to add to the array.
    */
    void insert(Uint32 index, const PEGASUS_ARRAY_T& x);

    /**
        Inserts a specified number of elements from a buffer into the array at
        a given index.  Subsequent elements are moved down.  The size of the
        array grows by the specified number of elements.
        @param index The index at which to insert the elements into the array.
        @param x Pointer to a buffer containing the elements to insert.
        @param size A Uint32 value specifying the number of elements to insert.
    */
    void insert(Uint32 index, const PEGASUS_ARRAY_T* x, Uint32 size);

    /**
        Removes the element at the given index from the array. The
        size of the array shrinks by one.
        @param index Specifies the array element to remove.
    */
    void remove(Uint32 index);

    /**
        Removes size elements starting at the given index. The size of
        the array shrinks by size elements.
        @param index Specifies where in the array to begin removing elements.
        @param size Uint32 size that specifies how many elements to remove
        from the array.
    */
    void remove(Uint32 index, Uint32 size);

private:

    PEGASUS_ARRAY_T* _data() const;

    void* _rep;
};

#endif //!defined(Pegasus_ArrayInter_h) || !defined(PEGASUS_ARRAY_T)

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2