Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DBUS_PROPERTY_H_ | 5 #ifndef DBUS_PROPERTY_H_ |
| 6 #define DBUS_PROPERTY_H_ | 6 #define DBUS_PROPERTY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 399 } | 399 } |
| 400 | 400 |
| 401 private: | 401 private: |
| 402 // Current cached value of the property. | 402 // Current cached value of the property. |
| 403 T value_; | 403 T value_; |
| 404 | 404 |
| 405 // Replacement value of the property. | 405 // Replacement value of the property. |
| 406 T set_value_; | 406 T set_value_; |
| 407 }; | 407 }; |
| 408 | 408 |
| 409 template <> Property<uint8>::Property(); | 409 template <> Property<uint8>::Property(); |
|
Nico
2014/07/25 16:46:50
…and this line is wrong too I think. Since the con
tzik
2014/07/29 05:52:36
These Property::Property()s seem specialization ra
| |
| 410 template <> bool Property<uint8>::PopValueFromReader(MessageReader* reader); | 410 template <> bool Property<uint8>::PopValueFromReader(MessageReader* reader); |
| 411 template <> void Property<uint8>::AppendSetValueToWriter(MessageWriter* writer); | 411 template <> void Property<uint8>::AppendSetValueToWriter(MessageWriter* writer); |
| 412 extern template class CHROME_DBUS_EXPORT Property<uint8>; | |
|
Nico
2014/07/25 16:37:23
Just removing the CHROME_DBUS_EXPORT should be eno
tzik
2014/07/29 05:52:36
That doesn't build successfully on clang+asan on l
| |
| 413 | 412 |
| 414 template <> Property<bool>::Property(); | 413 template <> Property<bool>::Property(); |
| 415 template <> bool Property<bool>::PopValueFromReader(MessageReader* reader); | 414 template <> bool Property<bool>::PopValueFromReader(MessageReader* reader); |
| 416 template <> void Property<bool>::AppendSetValueToWriter(MessageWriter* writer); | 415 template <> void Property<bool>::AppendSetValueToWriter(MessageWriter* writer); |
| 417 extern template class CHROME_DBUS_EXPORT Property<bool>; | |
| 418 | 416 |
| 419 template <> Property<int16>::Property(); | 417 template <> Property<int16>::Property(); |
| 420 template <> bool Property<int16>::PopValueFromReader(MessageReader* reader); | 418 template <> bool Property<int16>::PopValueFromReader(MessageReader* reader); |
| 421 template <> void Property<int16>::AppendSetValueToWriter(MessageWriter* writer); | 419 template <> void Property<int16>::AppendSetValueToWriter(MessageWriter* writer); |
| 422 extern template class CHROME_DBUS_EXPORT Property<int16>; | |
| 423 | 420 |
| 424 template <> Property<uint16>::Property(); | 421 template <> Property<uint16>::Property(); |
| 425 template <> bool Property<uint16>::PopValueFromReader(MessageReader* reader); | 422 template <> bool Property<uint16>::PopValueFromReader(MessageReader* reader); |
| 426 template <> void Property<uint16>::AppendSetValueToWriter( | 423 template <> void Property<uint16>::AppendSetValueToWriter( |
| 427 MessageWriter* writer); | 424 MessageWriter* writer); |
| 428 extern template class CHROME_DBUS_EXPORT Property<uint16>; | |
| 429 | 425 |
| 430 template <> Property<int32>::Property(); | 426 template <> Property<int32>::Property(); |
| 431 template <> bool Property<int32>::PopValueFromReader(MessageReader* reader); | 427 template <> bool Property<int32>::PopValueFromReader(MessageReader* reader); |
| 432 template <> void Property<int32>::AppendSetValueToWriter(MessageWriter* writer); | 428 template <> void Property<int32>::AppendSetValueToWriter(MessageWriter* writer); |
| 433 extern template class CHROME_DBUS_EXPORT Property<int32>; | |
| 434 | 429 |
| 435 template <> Property<uint32>::Property(); | 430 template <> Property<uint32>::Property(); |
| 436 template <> bool Property<uint32>::PopValueFromReader(MessageReader* reader); | 431 template <> bool Property<uint32>::PopValueFromReader(MessageReader* reader); |
| 437 template <> void Property<uint32>::AppendSetValueToWriter( | 432 template <> void Property<uint32>::AppendSetValueToWriter( |
| 438 MessageWriter* writer); | 433 MessageWriter* writer); |
| 439 extern template class CHROME_DBUS_EXPORT Property<uint32>; | |
| 440 | 434 |
| 441 template <> Property<int64>::Property(); | 435 template <> Property<int64>::Property(); |
| 442 template <> bool Property<int64>::PopValueFromReader(MessageReader* reader); | 436 template <> bool Property<int64>::PopValueFromReader(MessageReader* reader); |
| 443 template <> void Property<int64>::AppendSetValueToWriter(MessageWriter* writer); | 437 template <> void Property<int64>::AppendSetValueToWriter(MessageWriter* writer); |
| 444 extern template class CHROME_DBUS_EXPORT Property<int64>; | |
| 445 | 438 |
| 446 template <> Property<uint64>::Property(); | 439 template <> Property<uint64>::Property(); |
| 447 template <> bool Property<uint64>::PopValueFromReader(MessageReader* reader); | 440 template <> bool Property<uint64>::PopValueFromReader(MessageReader* reader); |
| 448 template <> void Property<uint64>::AppendSetValueToWriter( | 441 template <> void Property<uint64>::AppendSetValueToWriter( |
| 449 MessageWriter* writer); | 442 MessageWriter* writer); |
| 450 extern template class CHROME_DBUS_EXPORT Property<uint64>; | |
| 451 | 443 |
| 452 template <> Property<double>::Property(); | 444 template <> Property<double>::Property(); |
| 453 template <> bool Property<double>::PopValueFromReader(MessageReader* reader); | 445 template <> bool Property<double>::PopValueFromReader(MessageReader* reader); |
| 454 template <> void Property<double>::AppendSetValueToWriter( | 446 template <> void Property<double>::AppendSetValueToWriter( |
| 455 MessageWriter* writer); | 447 MessageWriter* writer); |
| 456 extern template class CHROME_DBUS_EXPORT Property<double>; | |
| 457 | 448 |
| 458 template <> bool Property<std::string>::PopValueFromReader( | 449 template <> bool Property<std::string>::PopValueFromReader( |
| 459 MessageReader* reader); | 450 MessageReader* reader); |
| 460 template <> void Property<std::string>::AppendSetValueToWriter( | 451 template <> void Property<std::string>::AppendSetValueToWriter( |
| 461 MessageWriter* writer); | 452 MessageWriter* writer); |
| 462 extern template class CHROME_DBUS_EXPORT Property<std::string>; | |
| 463 | 453 |
| 464 template <> bool Property<ObjectPath>::PopValueFromReader( | 454 template <> bool Property<ObjectPath>::PopValueFromReader( |
| 465 MessageReader* reader); | 455 MessageReader* reader); |
| 466 template <> void Property<ObjectPath>::AppendSetValueToWriter( | 456 template <> void Property<ObjectPath>::AppendSetValueToWriter( |
| 467 MessageWriter* writer); | 457 MessageWriter* writer); |
| 468 extern template class CHROME_DBUS_EXPORT Property<ObjectPath>; | |
| 469 | 458 |
| 470 template <> bool Property<std::vector<std::string> >::PopValueFromReader( | 459 template <> bool Property<std::vector<std::string> >::PopValueFromReader( |
| 471 MessageReader* reader); | 460 MessageReader* reader); |
| 472 template <> void Property<std::vector<std::string> >::AppendSetValueToWriter( | 461 template <> void Property<std::vector<std::string> >::AppendSetValueToWriter( |
| 473 MessageWriter* writer); | 462 MessageWriter* writer); |
| 474 extern template class CHROME_DBUS_EXPORT Property<std::vector<std::string> >; | |
| 475 | 463 |
| 476 template <> bool Property<std::vector<ObjectPath> >::PopValueFromReader( | 464 template <> bool Property<std::vector<ObjectPath> >::PopValueFromReader( |
| 477 MessageReader* reader); | 465 MessageReader* reader); |
| 478 template <> void Property<std::vector<ObjectPath> >::AppendSetValueToWriter( | 466 template <> void Property<std::vector<ObjectPath> >::AppendSetValueToWriter( |
| 479 MessageWriter* writer); | 467 MessageWriter* writer); |
| 480 extern template class CHROME_DBUS_EXPORT Property<std::vector<ObjectPath> >; | |
| 481 | 468 |
| 482 template <> bool Property<std::vector<uint8> >::PopValueFromReader( | 469 template <> bool Property<std::vector<uint8> >::PopValueFromReader( |
| 483 MessageReader* reader); | 470 MessageReader* reader); |
| 484 template <> void Property<std::vector<uint8> >::AppendSetValueToWriter( | 471 template <> void Property<std::vector<uint8> >::AppendSetValueToWriter( |
| 485 MessageWriter* writer); | 472 MessageWriter* writer); |
| 473 | |
| 474 #if defined(COMPILER_GCC) && !defined(__clang__) | |
| 475 extern template class Property<uint8>; | |
| 476 extern template class Property<bool>; | |
| 477 extern template class Property<int16>; | |
| 478 extern template class Property<uint16>; | |
| 479 extern template class Property<int32>; | |
| 480 extern template class Property<uint32>; | |
| 481 extern template class Property<int64>; | |
| 482 extern template class Property<uint64>; | |
| 483 extern template class Property<double>; | |
| 484 extern template class Property<std::string>; | |
| 485 extern template class Property<ObjectPath>; | |
| 486 extern template class Property<std::vector<std::string> >; | |
| 487 extern template class Property<std::vector<ObjectPath> >; | |
| 488 extern template class Property<std::vector<uint8> >; | |
| 489 #else | |
| 490 extern template class CHROME_DBUS_EXPORT Property<uint8>; | |
| 491 extern template class CHROME_DBUS_EXPORT Property<bool>; | |
| 492 extern template class CHROME_DBUS_EXPORT Property<int16>; | |
| 493 extern template class CHROME_DBUS_EXPORT Property<uint16>; | |
| 494 extern template class CHROME_DBUS_EXPORT Property<int32>; | |
| 495 extern template class CHROME_DBUS_EXPORT Property<uint32>; | |
| 496 extern template class CHROME_DBUS_EXPORT Property<int64>; | |
| 497 extern template class CHROME_DBUS_EXPORT Property<uint64>; | |
| 498 extern template class CHROME_DBUS_EXPORT Property<double>; | |
| 499 extern template class CHROME_DBUS_EXPORT Property<std::string>; | |
| 500 extern template class CHROME_DBUS_EXPORT Property<ObjectPath>; | |
| 501 extern template class CHROME_DBUS_EXPORT Property<std::vector<std::string> >; | |
| 502 extern template class CHROME_DBUS_EXPORT Property<std::vector<ObjectPath> >; | |
| 486 extern template class CHROME_DBUS_EXPORT Property<std::vector<uint8> >; | 503 extern template class CHROME_DBUS_EXPORT Property<std::vector<uint8> >; |
| 504 #endif | |
| 487 | 505 |
| 488 } // namespace dbus | 506 } // namespace dbus |
| 489 | 507 |
| 490 #endif // DBUS_PROPERTY_H_ | 508 #endif // DBUS_PROPERTY_H_ |
| OLD | NEW |