plitem.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00007 /*
00008   AUTHOR(S): Lilian Qin Lan (lan)
00009 
00010   RCS information
00011    $Name: OSB_060808 $
00012    $Revision: 1.17 $
00013 
00014   License
00015    OSB rating and billing library for communication networks
00016    Copyright (C) 2004, 2005, 2006  OSB systems
00017 
00018    This file may be distributed and/or modify under the terms of the
00019    GNU General Public License (GPL) as published by the Free Software
00020    Foundation which is provided in the file LICENSE.GPL included in the
00021    packaging of this file.
00022 
00023    The file is distributed in the hope that it will be useful, but WITHOUT
00024    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00025    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00026    for more details.
00027 
00028    Holders of a OSB Commercial License may use this file under the terms
00029    and conditions of this commercial license.
00030  */
00031 #ifndef _PLITEM_H_
00032 #define _PLITEM_H_
00033 
00034 // *********************************************************************
00035 // included header files
00036 // + standard includes
00037 
00038 // + local headers
00039 #include "osbid.h"
00040 #include "productitem.h"
00041 
00042 // *********************************************************************
00043 // class declarations
00044 namespace OSB_DB {
00045     class Session;
00046     class PricelistItemGw;
00047 }
00048 
00049 // *********************************************************************
00050 // namespace extensions
00051 namespace OSB_LIB {
00052 
00053 // *********************************************************************
00054 // forward declarations
00055     template<typename T> class Id;
00056     class Pricelist;
00057 
00058 // *********************************************************************
00059 // type definitions
00060 
00061 // *********************************************************************
00062 // class definitions
00063 
00064     // *****************************************************************
00065     // class PricelistItem
00075     class PricelistItem : public ProductItem {
00080         friend class OSB_DB::PricelistItemGw;
00081 
00082     public:
00084         static const Type type_;
00085 
00086         // Documentation from base class.
00087         typedef std::auto_ptr<PricelistItem> AutoPtr;
00088 
00089     public:
00097         PricelistItem(
00098             const Oid&         oid,
00099             const std::string& name = "",
00100             const std::string& des  = ""
00101         );
00102 
00111         PricelistItem(
00112             const Oid&           oid,
00113             const std::string&   name,
00114             const std::string&   des,
00115             const Id<Pricelist>& plId
00116         );
00117 
00118     public:
00119         // Documentation from base class.
00120         AutoPtr clone() const;
00121         Type type() const { return type_; }
00122 
00124 
00125 
00126         const Id<Pricelist>& plId() const;
00128 
00130 
00131 
00132         void setPlId(const Id<Pricelist>& plId);
00134 
00139         std::auto_ptr<PersProductItem>
00140         crePersProductItem() const;
00141 
00143         ProductItem::CfgType canConfigure() const;
00144 
00146         ProductItem::DefPersType canDefPers() const;
00147 
00149         CfgPersType canPersonalize() const;
00150 
00152         const PersProductItem* defPersItem() const;
00153 
00154     private:
00161 
00171         bool readSpecific(
00172             const OSB_DB::Session& session
00173         );
00174 
00185         bool insSpecific(
00186             const OSB_DB::Session& session
00187         );
00188 
00199         bool updSpecific(
00200             const OSB_DB::Session& session
00201         );
00202 
00212         bool delSpecific(
00213             const OSB_DB::Session& session
00214         );
00216 
00217         // Documentation from base class.
00218         ProductItem* clone_() const;
00219 
00220     private:
00222         Id<Pricelist> plId_;
00223     };                                  // class PricelistItem
00224 
00225 // *********************************************************************
00226 // inline definitions
00227 
00228 }                                       // namespace OSB_LIB
00229 #endif                                  // #ifndef _PLITEM_H_

Generated on Sat Sep 2 14:06:33 2006 for OSB Library by  doxygen 1.4.7