From 1e4329dd7d9d218c7d92a260ba5c8b7c297390f7 Mon Sep 17 00:00:00 2001 From: Klaus Kaempf Date: Sat, 25 Feb 2006 17:09:48 +0000 Subject: [PATCH] add 'Atom' Resolvable kind --- zypp/Atom.cc | 39 +++++++++++++++++++++++++++++++++++ zypp/Atom.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++ zypp/Makefile.am | 2 ++ zypp/ResTraits.cc | 2 ++ zypp/ResTraits.h | 1 + zypp/detail/AtomImplIf.cc | 35 +++++++++++++++++++++++++++++++ zypp/detail/AtomImplIf.h | 49 ++++++++++++++++++++++++++++++++++++++++++++ zypp/detail/Makefile.am | 4 +++- 8 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 zypp/Atom.cc create mode 100644 zypp/Atom.h create mode 100644 zypp/detail/AtomImplIf.cc create mode 100644 zypp/detail/AtomImplIf.h diff --git a/zypp/Atom.cc b/zypp/Atom.cc new file mode 100644 index 0000000..24fe120 --- /dev/null +++ b/zypp/Atom.cc @@ -0,0 +1,39 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ +/** \file zypp/Atom.cc + * +*/ +#include "zypp/Atom.h" + +using namespace std; + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // + // METHOD NAME : Atom::Atom + // METHOD TYPE : Ctor + // + Atom::Atom( const NVRAD & nvrad_r ) + : ResObject( TraitsType::kind, nvrad_r ) + {} + + /////////////////////////////////////////////////////////////////// + // + // METHOD NAME : Atom::~Atom + // METHOD TYPE : Dtor + // + Atom::~Atom() + {} + + ///////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// diff --git a/zypp/Atom.h b/zypp/Atom.h new file mode 100644 index 0000000..af1f1d4 --- /dev/null +++ b/zypp/Atom.h @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ +/** \file zypp/Atom.h + * +*/ +#ifndef ZYPP_ATOM_H +#define ZYPP_ATOM_H + +#include "zypp/ResObject.h" +#include "zypp/detail/AtomImplIf.h" + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // + // CLASS NAME : Atom + // + /** Class representing the message to be shown during update. + */ + class Atom : public ResObject + { + public: + typedef detail::AtomImplIf Impl; + typedef Atom Self; + typedef ResTraits TraitsType; + typedef TraitsType::PtrType Ptr; + typedef TraitsType::constPtrType constPtr; + + protected: + Atom( const NVRAD & nvrad_r ); + /** Dtor */ + virtual ~Atom(); + + private: + /** Access implementation */ + virtual Impl & pimpl() = 0; + /** Access implementation */ + virtual const Impl & pimpl() const = 0; + }; + + ///////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// +#endif // ZYPP_ATOM_H diff --git a/zypp/Makefile.am b/zypp/Makefile.am index d8d3685..9f88998 100644 --- a/zypp/Makefile.am +++ b/zypp/Makefile.am @@ -10,6 +10,7 @@ INCLUDES = -DZYPP_BASE_LOGGER_LOGGROUP=\"zypp\" pkginclude_HEADERS = NeedAType.h \ Arch.h \ + Atom.h \ Bit.h \ ByteCount.h \ CapAndItem.h \ @@ -93,6 +94,7 @@ lib_LTLIBRARIES = lib@PACKAGE@.la lib@PACKAGE@_la_SOURCES = \ LanguageCode.cc \ Arch.cc \ + Atom.h \ ByteCount.cc \ Capability.cc \ CapFactory.cc \ diff --git a/zypp/ResTraits.cc b/zypp/ResTraits.cc index f02cc57..235a766 100644 --- a/zypp/ResTraits.cc +++ b/zypp/ResTraits.cc @@ -32,6 +32,8 @@ namespace zypp const ResolvableTraits::KindType ResTraits ::kind( "Message" ); template<> const ResolvableTraits::KindType ResTraits ::kind( "Language" ); + template<> + const ResolvableTraits::KindType ResTraits ::kind( "Atom" ); template<> const ResolvableTraits::KindType ResTraits ::kind( "System" ); diff --git a/zypp/ResTraits.h b/zypp/ResTraits.h index db91474..e8abff8 100644 --- a/zypp/ResTraits.h +++ b/zypp/ResTraits.h @@ -22,6 +22,7 @@ namespace zypp class Resolvable; class ResObject; + class Atom; class Package; class SrcPackage; class Selection; diff --git a/zypp/detail/AtomImplIf.cc b/zypp/detail/AtomImplIf.cc new file mode 100644 index 0000000..261a359 --- /dev/null +++ b/zypp/detail/AtomImplIf.cc @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ +/** \file zypp/detail/AtomImplIf.cc + * +*/ +#include "zypp/detail/AtomImplIf.h" +#include + +using namespace std; + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// + namespace detail + { ///////////////////////////////////////////////////////////////// + + ///////////////////////////////////////////////////////////////// + // Default implementation of AtomImplIf attributes, + // as far as reasonable. + ///////////////////////////////////////////////////////////////// + + + ///////////////////////////////////////////////////////////////// + } // namespace detail + /////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// diff --git a/zypp/detail/AtomImplIf.h b/zypp/detail/AtomImplIf.h new file mode 100644 index 0000000..264e5c1 --- /dev/null +++ b/zypp/detail/AtomImplIf.h @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ +/** \file zypp/detail/AtomImplIf.h + * +*/ +#ifndef ZYPP_DETAIL_ATOMIMPLIF_H +#define ZYPP_DETAIL_ATOMIMPLIF_H + +#include "zypp/detail/ResObjectImplIf.h" + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// + + class Atom; + + /////////////////////////////////////////////////////////////////// + namespace detail + { ///////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // + // CLASS NAME : AtomImplIf + // + /** Abstact Atom implementation interface. + */ + class AtomImplIf : public ResObjectImplIf + { + public: + typedef Atom ResType; + + public: + + }; + /////////////////////////////////////////////////////////////////// + + ///////////////////////////////////////////////////////////////// + } // namespace detail + /////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// +#endif // ZYPP_DETAIL_ATOMIMPLIF_H diff --git a/zypp/detail/Makefile.am b/zypp/detail/Makefile.am index 1ab30dc..a060110 100644 --- a/zypp/detail/Makefile.am +++ b/zypp/detail/Makefile.am @@ -14,9 +14,10 @@ detailinclude_HEADERS = \ ResObjectImplIf.h \ ResObjectFactory.h \ PackageImplIf.h \ + AtomImplIf.h \ LanguageImplIf.h \ SelectionImplIf.h \ - PatternImplIf.h \ + PatternImplIf.h \ MessageImplIf.h \ ScriptImplIf.h \ PatchImplIf.h \ @@ -43,6 +44,7 @@ lib@PACKAGE@_detail_la_SOURCES = \ ResolvableImpl.cc \ ResObjectImplIf.cc \ PackageImplIf.cc \ + AtomImplIf.cc \ LanguageImplIf.cc \ SelectionImplIf.cc \ PatternImplIf.cc \ -- 2.7.4