///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
// All rights reserved.
//
// This software and its documentation and related materials are owned by
// the Alliance. The software may only be incorporated into application
// programs owned by members of the Alliance, subject to a signed
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable
// trade secrets of the Alliance and its suppliers. The software is also
// protected by copyright law and international treaty provisions. Application
// programs incorporating this software must include the following statement
// with their copyright notices:
//
// This application incorporates Open Design Alliance software pursuant to a license
// agreement with Open Design Alliance.
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
// All rights reserved.
//
// By use of this software, its documentation or related materials, you
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
#ifndef _SDAI_ATTTRIBUTE_DATA_BLOCK_VALUE_H
#define _SDAI_ATTTRIBUTE_DATA_BLOCK_VALUE_H
#include "OdaCommon.h"
#include "daiBuildOptions.h"
#include "daiADB_Value.h"
#include "sdai.h"
#define STL_USING_VECTOR
#define STL_USING_STRING
#include "OdaSTL.h"
#include "TD_PackPush.h"
/** \details
Implements the Data Access Interface (DAI) that provides functionality for manipulating data that is defined within the EXPRESS SCHEMA format.
*/
namespace OdDAI
{
/** \details
A class that stores and handles the path of the Select data.
*/
class DAI_EXPORT SafePathHolder
{
public:
/** \details
Creates a new empty path holder.
*/
SafePathHolder();
/** \details
Creates a new empty path holder as a copy of another path holder object (copy constructor)
\param rightValue [in] A path holder object to copy from.
*/
SafePathHolder(const SafePathHolder& rightValue);
/** \details
Destroys the path holder object.
*/
~SafePathHolder();
/** \details
Compares two path holder objects (comparison operator).
\param rightValue [in] A path holder object to compare (the right-hand operand of the comparison operation).
\returns true if path holder objects are equal; otherwise, the operator returns false.
*/
bool operator== (const SafePathHolder& rightValue) const;
/** \details
Copy one path holder object to another (assignment operator).
\param rightValue [in] Another path holder object to copy from (the right-hand operand of the assignment operation).
\returns The reference to the path holder object modified by the assignment operation.
*/
SafePathHolder& operator=(const SafePathHolder& rightValue);
/** \details
Provides a path array from the path holder object.
\param typeNameNumber [out] A quantity of items the provided array contains.
\returns A raw pointer to the array of path ; if the path is empty, the method returns the NULL pointer.
*/
const SdaiString* getPath(SdaiInteger& typeNameNumber) const;
/** \details
Sets a path array to the path holder object.
\param typeNameNumber [in] A quantity of items the path array contains.
\param typeNameVector [in] A raw pointer to the path array .
*/
void putPath(SdaiInteger typeNameNumber, SdaiString* typeNameVector);
/** \details
Sets a path to the path holder object.
\param typeNameVector [in] An original type path (that looks like: "type1/type2/type3").
*/
void putPath(const std::string& typeNameVector);
/** \details
Appends an additional value to the array of type paths for the path holder object.
\param addeValue [in] A that contains the original type path to add (that looks like: "type1/type2/type3").
*/
void add(const SdaiString addeValue);
/** \details
Removes all data and clears all buffers.
*/
void clearAll();
/** \details
Reserve a buffer in memory with a requested size of bytes.
\param count [in] A size of buffer in bytes.
*/
void reserve(const size_t& count);
//DOM-IGNORE-BEGIN
private:
// need for SdaiString row array providing
std::vector m_pathes;
//DOM-IGNORE-END
};
}
/** \details
Implements the Data Access Interface (DAI) that provides functionality for manipulating data that is defined within the EXPRESS SCHEMA format.
*/
namespace OdDAI
{
/** \details
A class that implements working with attribute data blocks. An attribute data block is used for simple move, copy, edit operations for Select data type.
*/
class DAI_EXPORT AttributeDataBlock
{
public:
/** \details
Creates a new empty instance of attribute data block.
*/
AttributeDataBlock();
/** \details
Creates a new empty instance of attribute data block as a copy of another attribute data block (copy constructor).
\param rightValue [in] Another attribute data block object to copy from.
*/
AttributeDataBlock(const AttributeDataBlock& rightValue);
/** \details
Compares two attribute data block.
\param rightValue [in] Another attribute data block to compare (the right-hand operand of the comparison operation).
\returns true if attribute data block objects are equal; otherwise, the operator returns false.
*/
bool operator== (const AttributeDataBlock& rightValue) const;
/** \details
Copies one attribute data block object to another (assignment operator).
\param rightValue [in] Another attribute data block object to copy from (the right-hand operand of the assignment operation).
\returns The reference to the attribute data block modified with the assignment operator.
*/
AttributeDataBlock& operator=(const AttributeDataBlock& rightValue);
/** \details
Converts the attribute data block data into a string representation.
\returns A string that contains text representation of the attribute data block information.
*/
OdString toString() const;
/** \details
Clears all data.
*/
void unset();
/** \details
Gets the value type path.
If the attribute data block contains an , the method returns the type name of the application instance.
\param getFrom [in] An attribute data block object to get the type path from.
\returns A that contains the specified type path.
*/
static SdaiString getValueSpecifiedTypePath(const AttributeDataBlock& getFrom);
//DOM-IGNORE-BEGIN
public:
ADB_Value value;
SafePathHolder typePath;
//DOM-IGNORE-END
};
}
#include "TD_PackPop.h"
#endif