-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements for conddb dump command #20215
Merged
cmsbuild
merged 6 commits into
cms-sw:master
from
ggovi:condcore-utilities-cond2xml-improv-0-93X
Aug 29, 2017
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bcd76c9
Improvements for: handling of xml converters from built-in libraries…
ggovi 679ddaa
Added forgotten file...
ggovi 75db869
Removed forgotten file...
ggovi 80bdf34
Moved BeamSpot 2XML module in the built-in library
ggovi 5194cd4
Fixed support for templated classes. Moved built-in converters in the…
ggovi 0d5f27e
Added include guard
ggovi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
CondCore/EcalPlugins/plugins/EcalCondObjectContainer_EcalTPGCrystalStatusCode_toXML.cc
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#ifndef CondCore_Utilities_Payload2XMLModule_h | ||
#define CondCore_Utilities_Payload2XMLModule_h | ||
|
||
#include <string> | ||
#include <memory> | ||
|
||
#include <boost/python.hpp> | ||
#include "boost/archive/xml_oarchive.hpp" | ||
|
||
#include "CondFormats/Serialization/interface/Archive.h" | ||
|
||
#define XML_CONVERTER_NAME( CLASS_NAME ) (std::string( #CLASS_NAME )+"2xml").c_str() | ||
|
||
#define PAYLOAD_2XML_MODULE( MODULE_NAME ) \ | ||
BOOST_PYTHON_MODULE( MODULE_NAME ) | ||
|
||
#define PAYLOAD_2XML_CLASS( CLASS_NAME ) \ | ||
boost::python::class_< Payload2xml<CLASS_NAME> >( XML_CONVERTER_NAME( CLASS_NAME ), boost::python::init<>()) \ | ||
.def("write",&Payload2xml<CLASS_NAME>::write ) \ | ||
; | ||
|
||
namespace { // Avoid cluttering the global namespace. | ||
|
||
template <typename PayloadType> class Payload2xml { | ||
public: | ||
Payload2xml(){ | ||
} | ||
// | ||
std::string write( const std::string &payloadData ){ | ||
// now to convert | ||
std::unique_ptr< PayloadType > payload; | ||
std::stringbuf sdataBuf; | ||
sdataBuf.pubsetbuf( const_cast<char *> ( payloadData.c_str() ), payloadData.size() ); | ||
|
||
std::istream inBuffer( &sdataBuf ); | ||
eos::portable_iarchive ia( inBuffer ); | ||
payload.reset( new PayloadType ); | ||
ia >> (*payload); | ||
|
||
// now we have the object in memory, convert it to xml in a string and return it | ||
std::ostringstream outBuffer; | ||
{ | ||
boost::archive::xml_oarchive xmlResult( outBuffer ); | ||
xmlResult << boost::serialization::make_nvp( "cmsCondPayload", *payload ); | ||
} | ||
return outBuffer.str(); | ||
} | ||
}; | ||
|
||
} // end namespace | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "CondCore/Utilities/interface/Payload2XMLModule.h" | ||
#include "CondCore/Utilities/src/CondFormats.h" | ||
|
||
PAYLOAD_2XML_MODULE( pluginUtilities_payload2xml ){ | ||
PAYLOAD_2XML_CLASS( BeamSpotObjects ); | ||
PAYLOAD_2XML_CLASS( EcalCondObjectContainer<EcalPedestal> ); | ||
PAYLOAD_2XML_CLASS( EcalLaserAPDPNRatios ); | ||
PAYLOAD_2XML_CLASS( RunInfo ); | ||
PAYLOAD_2XML_CLASS( SiStripLatency ); | ||
PAYLOAD_2XML_CLASS( SiStripConfObject ); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @ggovi - please add an include guard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, just forgotten - done now.