MetaColumn.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //
  2. // MetaColumn.cpp
  3. //
  4. // Library: Data
  5. // Package: DataCore
  6. // Module: MetaColumn
  7. //
  8. // Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
  9. // and Contributors.
  10. //
  11. // SPDX-License-Identifier: BSL-1.0
  12. //
  13. #include "Poco/Data/MetaColumn.h"
  14. namespace Poco {
  15. namespace Data {
  16. MetaColumn::MetaColumn():
  17. _length(),
  18. _precision(),
  19. _position(),
  20. _type(),
  21. _nullable()
  22. {
  23. }
  24. MetaColumn::MetaColumn(std::size_t position,
  25. const std::string& name,
  26. ColumnDataType type,
  27. std::size_t length,
  28. std::size_t precision,
  29. bool nullable):
  30. _name(name),
  31. _length(length),
  32. _precision(precision),
  33. _position(position),
  34. _type(type),
  35. _nullable(nullable)
  36. {
  37. }
  38. MetaColumn::MetaColumn(const MetaColumn& other):
  39. _name(other._name),
  40. _length(other._length),
  41. _precision(other._precision),
  42. _position(other._position),
  43. _type(other._type),
  44. _nullable(other._nullable)
  45. {
  46. }
  47. MetaColumn::MetaColumn(MetaColumn&& other) noexcept:
  48. _name(std::move(other._name)),
  49. _length(other._length),
  50. _precision(other._precision),
  51. _position(other._position),
  52. _type(other._type),
  53. _nullable(other._nullable)
  54. {
  55. }
  56. MetaColumn::~MetaColumn()
  57. {
  58. }
  59. MetaColumn& MetaColumn::operator = (const MetaColumn& other)
  60. {
  61. MetaColumn tmp(other);
  62. swap(tmp);
  63. return *this;
  64. }
  65. MetaColumn& MetaColumn::operator = (MetaColumn&& other) noexcept
  66. {
  67. _name = std::move(other._name);
  68. _length = other._length;
  69. _precision = other._precision;
  70. _position = other._position;
  71. _type = other._type;
  72. _nullable = other._nullable;
  73. return *this;
  74. }
  75. void MetaColumn::swap(MetaColumn& other)
  76. {
  77. std::swap(_name, other._name);
  78. std::swap(_length, other._length);
  79. std::swap(_precision, other._precision);
  80. std::swap(_position, other._position);
  81. std::swap(_type, other._type);
  82. std::swap(_nullable, other._nullable);
  83. }
  84. } } // namespace Poco::Data