Advertisement
lpp

Untitled

lpp
Mar 25th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. #ifndef ALIAS_HPP
  2. #define ALIAS_HPP
  3.  
  4. #include <vector>
  5. #include <map>
  6. #include <string>
  7. #include <iostream>
  8.  
  9. /**
  10.     @brief Klasa koja sluzi za bijektivno mapiranje objakta tipa U na objekt tipa W
  11.     Za ispis i upis se koristi in i out stream-ovi
  12.     Za klase U i W treba paziti da imaju svoju vizualnu reprezentaciju bez razmaka
  13. */
  14. template<class U, class W>
  15. class Alias
  16. {
  17. public:
  18.     void SetAlias(const U & S, const W x);
  19.     void RemAlias(const U & S);
  20.     void RemAlias(const W x);
  21.  
  22.     bool Exist(const U & S) const;
  23.     bool Exist(const W & x) const;
  24.  
  25.     const U & GetName(const W x);
  26.     const W & GetNo(const U & S);
  27.     void Clear();
  28.  
  29.     friend std::ostream& operator<<( std::ostream & out, const Alias<U, W> & A);
  30.     friend std::istream& operator>>( std::istream & in, Alias<U, W> & A);
  31. private:
  32.     std::map<U, W> StoI;
  33.     std::map<W, U> ItoS;
  34. };
  35. #endif ALIAS_HPP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement