- Main Page
- Related Pages
- Modules
- Classes
- Files

# ICreateMeasureUnit.h

Go to the documentation of this file.

    00001 #ifndef _ICREATEMEASUREUNIT_H_
    00002 #define _ICREATEMEASUREUNIT_H_
    00003 //
    00004
    00005 //
    00006 // Copyright (C) 2004-2006  Autodesk, Inc.
    00007 //
    00008 // This library is free software; you can redistribute it and/or
    00009 // modify it under the terms of version 2.1 of the GNU Lesser
    00010 // General Public License as published by the Free Software Foundation.
    00011 //
    00012 // This library is distributed in the hope that it will be useful,
    00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00015 // Lesser General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU Lesser General Public
    00018 // License along with this library; if not, write to the Free Software
    00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    00020 //
    00021
    00022 #ifdef _WIN32
    00023 #pragma once
    00024 #endif
    00025
    00026 #include <FdoStd.h>
    00027 #include <Fdo/Connections/IConnection.h>
    00028 #include <Fdo/Commands/UnitOfMeasure/BaseUnit.h>
    00029 #include <Fdo/Commands/ICommand.h>
    00030
    00031 /// \brief
    00032 /// The FdoICreateMeasureUnit interface defines the CreateMeasureUnit command,
    00033 /// which creates or updates a measurement unit. Input to the command includes
    00034 /// the abbreviation, name, description, measure type, base unit, and scale
    00035 /// factor that defines the measure unit. The update existing flag indicates how
    00036 /// the command should behave in the presence of an existing measure unit. If it is
    00037 /// false, and the specified measure unit already exists, command execution will
    00038 /// fail. If it is true, the command will either create a new measure unit or update an
    00039 /// existing one.
    00040 class FdoICreateMeasureUnit : public FdoICommand
    00041 {
    00042     friend class FdoIConnection;
    00043
    00044 public:
    00045     /// \brief
    00046     /// Gets the abbreviation of the measure unit to create or update as a
    00047     /// string. Abbreviations must be unique because they define the identity of a
    00048     /// measurement unit.
    00049     ///
    00050     /// \return
    00051     /// Returns the abbreviation for the measure unit
    00052     ///
    00053     FDO_API virtual FdoString* GetAbbreviation() = 0;
    00054
    00055     /// \brief
    00056     /// Sets the abbreviation of the measure unit to create or update as a
    00057     /// string. Abbreviations must be unique because they define the identity of a
    00058     /// measurement unit.
    00059     ///
    00060     /// \param value
    00061     /// Input the abbreviation for the measure unit
    00062     ///
    00063     /// \return
    00064     /// Returns nothing
    00065     ///
    00066     FDO_API virtual void SetAbbreviation(FdoString* value) = 0;
    00067
    00068     /// \brief
    00069     /// Gets the name of the measure unit to create or update as a string.
    00070     ///
    00071     /// \return
    00072     /// Returns the name for the measure unit
    00073     ///
    00074     FDO_API virtual FdoString* GetName() = 0;
    00075
    00076     /// \brief
    00077     /// Sets the name of the measure unit to create or update as a string.
    00078     ///
    00079     /// \param value
    00080     /// Input the name for the measure unit
    00081     ///
    00082     /// \return
    00083     /// Returns nothing
    00084     ///
    00085     FDO_API virtual void SetName(FdoString* value) = 0;
    00086
    00087     /// \brief
    00088     /// Gets the description of the measure unit to create or update as a string.
    00089     ///
    00090     /// \return
    00091     /// Returns the description for the measure unit
    00092     ///
    00093     FDO_API virtual FdoString* GetDescription() = 0;
    00094
    00095     /// \brief
    00096     /// Sets the description of the measure unit to create or update as a string.
    00097     ///
    00098     /// \param value
    00099     /// Input the description for the measure unit
    00100     ///
    00101     /// \return
    00102     /// Returns nothing
    00103     ///
    00104     FDO_API virtual void SetDescription(FdoString* value) = 0;
    00105
    00106     /// \brief
    00107     /// Gets the base units that define the measure unit to create or update
    00108     /// as an FdoBaseUnit value.
    00109     ///
    00110     /// \return
    00111     /// Returns the base units
    00112     ///
    00113     FDO_API virtual FdoBaseUnit GetBaseUnit() = 0;
    00114
    00115     /// \brief
    00116     /// Sets the base units that define the measure unit to create or update
    00117     /// as an FdoBaseUnit value.
    00118     ///
    00119     /// \param value
    00120     /// Input the base units
    00121     ///
    00122     /// \return
    00123     /// Returns nothing
    00124     ///
    00125     FDO_API virtual void SetBaseUnit(FdoBaseUnit value) = 0;
    00126
    00127     /// \brief
    00128     /// Gets the scale factor to be applied to the base unit in order to get
    00129     /// one of the units being defined.
    00130     ///
    00131     /// \return
    00132     /// Returns the scale factor
    00133     ///
    00134     FDO_API virtual double GetScaleFactor() = 0;
    00135
    00136     /// \brief
    00137     /// Sets the scale factor to be applied to the base unit in order to get
    00138     /// one of the units being defined.
    00139     ///
    00140     /// \param value
    00141     /// Input the scale factor
    00142     ///
    00143     /// \return
    00144     /// Returns nothing
    00145     ///
    00146     FDO_API virtual void SetScaleFactor(double value) = 0;
    00147
    00148     /// \brief
    00149     /// Gets a Boolean flag that indicates how the CreateMeasureUnit command
    00150     /// should behave if the measure unit already exists. If update existing is
    00151     /// true and a measure unit with the specified abbreviation already exists
    00152     /// then it will be updated. If update existing is false and a measure unit
    00153     /// with the specified abbreviation already exists, command execution
    00154     /// will fail.
    00155     ///
    00156     /// \return
    00157     /// Returns true if the existing measure unit can be updated
    00158     ///
    00159     FDO_API virtual bool GetUpdateExisting() = 0;
    00160
    00161     /// \brief
    00162     /// Sets a Boolean flag that indicates how the CreateMeasureUnit command
    00163     /// should behave if the measure unit already exists. If update existing
    00164     /// is true and a measure unit of the specified name already exists,
    00165     /// it will be updated. If update existing is false and a measure unit of
    00166     /// the specified name already exists, command execution will fail.
    00167     ///
    00168     /// \param value
    00169     /// Input Indicates if the existing measure unit can be updated
    00170     ///
    00171     /// \return
    00172     /// Returns nothing
    00173     ///
    00174     FDO_API virtual void SetUpdateExisting(bool value) = 0;
    00175
    00176     /// \brief
    00177     /// Executes the CreateMeasureUnit command. If the measure unit already
    00178     /// exists and the update existing flag is set to false, an exception is thrown.
    00179     ///
    00180     /// \return
    00181     /// Returns nothing
    00182     ///
    00183     FDO_API virtual void Execute() = 0;
    00184 };
    00185 #endif
    00186
    00187

Please send us your comment about this page